From 4db1a4f15ef704b6b6faf1741054d59cb527298a Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sat, 5 Jan 2013 09:15:28 -0800 Subject: Move i_listlen in struct inclist for better packing in 64-bit builds Putting it with another int instead of between two pointers gets rid of two places where 4 bytes each had to be padded into the structure for alignment. Reduces the size of an individual struct from 64 bytes to 56 bytes, and of the inclist[ MAXFILES ] array from 128k to 112k. Found by clang: ./def.h:111:18: warning: padding struct 'struct inclist' with 4 bytes to align 'i_defs' [-Wpadded] struct symtab **i_defs; /* symbol table for this file and its ^ ./def.h:114:12: warning: padding struct 'struct inclist' with 4 bytes to align 'i_merged' [-Wpadded] boolean *i_merged; /* whether we have merged child Signed-off-by: Alan Coopersmith --- def.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/def.h b/def.h index 3f55a52..459bbd2 100644 --- a/def.h +++ b/def.h @@ -107,9 +107,9 @@ struct inclist { char *i_incstring; /* string from #include line */ char *i_file; /* path name of the include file */ struct inclist **i_list; /* list of files it itself includes */ - int i_listlen; /* length of i_list */ struct symtab **i_defs; /* symbol table for this file and its children when merged */ + int i_listlen; /* length of i_list */ int i_ndefs; /* current # defines */ boolean *i_merged; /* whether we have merged child defines */ -- cgit v1.2.3