bgpd: Optimize memory for ecommunity struct

```
struct ecommunity {
	long unsigned int          refcnt;               /*     0     8 */
	uint8_t                    unit_size;            /*     8     1 */
	_Bool                      disable_ieee_floating; /*     9     1 */

	/* XXX 2 bytes hole, try to pack */

	uint32_t                   size;                 /*    12     4 */
	uint8_t *                  val;                  /*    16     8 */
	char *                     str;                  /*    24     8 */

	/* size: 32, cachelines: 1, members: 6 */
	/* sum members: 30, holes: 1, sum holes: 2 */
	/* last cacheline: 32 bytes */
};   /* saved 8 bytes! */
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
This commit is contained in:
Donatas Abraitis 2024-02-09 17:21:23 +02:00
parent 1fce318efc
commit d13abf1180

View File

@ -117,6 +117,9 @@ struct ecommunity {
*/
uint8_t unit_size;
/* Disable IEEE floating-point encoding for extended community */
bool disable_ieee_floating;
/* Size of Extended Communities attribute. */
uint32_t size;
@ -125,9 +128,6 @@ struct ecommunity {
/* Human readable format string. */
char *str;
/* Disable IEEE floating-point encoding for extended community */
bool disable_ieee_floating;
};
struct ecommunity_as {