From: Arran Cudbard-Bell Date: Fri, 28 Jan 2022 21:08:28 +0000 (-0600) Subject: Add binary to print out structure sizes X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1dec51b6f6f6368f4f4cda37d978496a67411155;p=thirdparty%2Ffreeradius-server.git Add binary to print out structure sizes --- diff --git a/src/bin/radsizes.mk b/src/bin/radsizes.mk new file mode 100644 index 00000000000..84c9146c0fd --- /dev/null +++ b/src/bin/radsizes.mk @@ -0,0 +1,2 @@ +TARGET := radsizes +SOURCES := sizes.c diff --git a/src/bin/sizes.c b/src/bin/sizes.c new file mode 100644 index 00000000000..10d27a09bbf --- /dev/null +++ b/src/bin/sizes.c @@ -0,0 +1,21 @@ +#include + +#include +#include +#include + +int main(UNUSED int argc, UNUSED char **argv) +{ +#define SIZEOF(_struct) printf("%s %zu bytes\n", STRINGIFY(_struct), sizeof(_struct)) + + SIZEOF(xlat_exp_t); + SIZEOF(xlat_call_t); + SIZEOF(tmpl_t); + SIZEOF(tmpl_rules_t); + SIZEOF(tmpl_attr_rules_t); + SIZEOF(tmpl_xlat_rules_t); + SIZEOF(fr_value_box_t); + SIZEOF(fr_pair_t); + + return 0; +}