diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2013-01-05 09:15:28 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2013-01-05 09:46:41 -0800 |
commit | 4db1a4f15ef704b6b6faf1741054d59cb527298a (patch) | |
tree | 7eb61cb0fb54aa0b4e99daaf0223345f98ffbc1b | |
parent | c5378d3e7bb79880b9ea6f7f055393ae42eae55f (diff) |
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 <alan.coopersmith@oracle.com>
-rw-r--r-- | def.h | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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 */ |