Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bgpd: Optimize memory usage for bgp_aggregate struct
``` struct bgp_aggregate { uint8_t summary_only; /* 0 1 */ uint8_t as_set; /* 1 1 */ uint8_t origin; /* 2 1 */ _Bool med_mismatched; /* 3 1 */ _Bool med_initialized; /* 4 1 */ _Bool match_med; /* 5 1 */ /* XXX 2 bytes hole, try to pack */ struct { char * name; /* 8 8 */ struct route_map * map; /* 16 8 */ } rmap; /* 8 16 */ long unsigned int count; /* 24 8 */ long unsigned int incomplete_origin_count; /* 32 8 */ long unsigned int egp_origin_count; /* 40 8 */ struct hash * community_hash; /* 48 8 */ struct hash * ecommunity_hash; /* 56 8 */ /* --- cacheline 1 boundary (64 bytes) --- */ struct hash * lcommunity_hash; /* 64 8 */ struct hash * aspath_hash; /* 72 8 */ struct community * community; /* 80 8 */ struct ecommunity * ecommunity; /* 88 8 */ struct lcommunity * lcommunity; /* 96 8 */ struct aspath * aspath; /* 104 8 */ safi_t safi; /* 112 4 */ uint32_t med_matched_value; /* 116 4 */ char * suppress_map_name; /* 120 8 */ /* --- cacheline 2 boundary (128 bytes) --- */ struct route_map * suppress_map; /* 128 8 */ /* size: 136, cachelines: 3, members: 22 */ /* sum members: 134, holes: 1, sum holes: 2 */ /* last cacheline: 8 bytes */ }; ``` Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
- Loading branch information