mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-14 22:10:19 +00:00
bgpd: Optimize memory usage for bgp_nlri struct
``` struct bgp_nlri { uint16_t afi; /* 0 2 */ uint8_t safi; /* 2 1 */ /* XXX 1 byte hole, try to pack */ bgp_size_t length; /* 4 2 */ /* XXX 2 bytes hole, try to pack */ uint8_t * nlri; /* 8 8 */ /* size: 16, cachelines: 1, members: 4 */ /* sum members: 13, holes: 2, sum holes: 3 */ /* last cacheline: 16 bytes */ }; /* saved 8 bytes! */ ``` Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
This commit is contained in:
parent
7133cce196
commit
89e124f042
@ -1890,11 +1890,11 @@ struct bgp_nlri {
|
|||||||
/* SAFI. */
|
/* SAFI. */
|
||||||
uint8_t safi; /* iana_safi_t */
|
uint8_t safi; /* iana_safi_t */
|
||||||
|
|
||||||
/* Pointer to NLRI byte stream. */
|
|
||||||
uint8_t *nlri;
|
|
||||||
|
|
||||||
/* Length of whole NLRI. */
|
/* Length of whole NLRI. */
|
||||||
bgp_size_t length;
|
bgp_size_t length;
|
||||||
|
|
||||||
|
/* Pointer to NLRI byte stream. */
|
||||||
|
uint8_t *nlri;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* BGP versions. */
|
/* BGP versions. */
|
||||||
|
Loading…
Reference in New Issue
Block a user