From 7133cce19621746cba36e142060816fd6de7b64a Mon Sep 17 00:00:00 2001 From: Donatas Abraitis Date: Mon, 29 Jan 2024 15:29:25 +0200 Subject: [PATCH] bgpd: Optimize memory usage for bgp_notify struct ``` struct bgp_notify { uint8_t code; /* 0 1 */ uint8_t subcode; /* 1 1 */ bgp_size_t length; /* 2 2 */ _Bool hard_reset; /* 4 1 */ /* XXX 3 bytes hole, try to pack */ char * data; /* 8 8 */ uint8_t * raw_data; /* 16 8 */ /* size: 24, cachelines: 1, members: 6 */ /* sum members: 21, holes: 1, sum holes: 3 */ /* last cacheline: 24 bytes */ }; /* saved 16 bytes! */ ``` Signed-off-by: Donatas Abraitis --- bgpd/bgpd.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bgpd/bgpd.h b/bgpd/bgpd.h index a1593421be..8bde9999f9 100644 --- a/bgpd/bgpd.h +++ b/bgpd/bgpd.h @@ -888,10 +888,10 @@ struct peer_group { struct bgp_notify { uint8_t code; uint8_t subcode; - char *data; bgp_size_t length; - uint8_t *raw_data; bool hard_reset; + char *data; + uint8_t *raw_data; }; /* Next hop self address. */