From: Alan T. DeKok Date: Wed, 23 Nov 2011 13:31:54 +0000 (+0100) Subject: Re-arrange structure to remove padding X-Git-Tag: release_3_0_0_beta0~482 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6be14f5d90e8fc9243d0c54223f00990f40ce1f2;p=thirdparty%2Ffreeradius-server.git Re-arrange structure to remove padding This saves 8 bytes per VP on a 64-bit machine. That adds up... --- diff --git a/src/include/libradius.h b/src/include/libradius.h index ca70e713ffe..2a5033d4d40 100644 --- a/src/include/libradius.h +++ b/src/include/libradius.h @@ -166,10 +166,15 @@ typedef union value_pair_data { typedef struct value_pair { const char *name; + struct value_pair *next; + + /* + * Pack 4 32-bit fields together. Saves ~8 bytes per struct + * on 64-bit machines. + */ unsigned int attribute; unsigned int vendor; int type; - size_t length; /* of data */ #ifdef __cplusplus /* * C++ hackery. The server and modules are all C, so @@ -180,8 +185,10 @@ typedef struct value_pair { #else FR_TOKEN operator; #endif + ATTR_FLAGS flags; - struct value_pair *next; + + size_t length; /* of data field */ VALUE_PAIR_DATA data; } VALUE_PAIR; #define vp_strvalue data.strvalue