From: René Scharfe Date: Tue, 25 Oct 2011 18:00:04 +0000 (+0200) Subject: cache.h: put single NUL at end of struct cache_entry X-Git-Tag: v1.7.9-rc0~86^2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=ee7825b58cd423ea63a215c59fc2b7c7a2878af5;p=git.git cache.h: put single NUL at end of struct cache_entry Since in-memory index entries are allocated individually now, the variable slack at the end meant to provide an eight byte alignment is not needed anymore. Have a single NUL instead. This saves zero to seven bytes for an entry, depending on its filename length. Signed-off-by: Rene Scharfe Signed-off-by: Junio C Hamano --- diff --git a/cache.h b/cache.h index 59840a4dc..15c619d16 100644 --- a/cache.h +++ b/cache.h @@ -306,7 +306,7 @@ static inline unsigned int canon_mode(unsigned int mode) } #define flexible_size(STRUCT,len) ((offsetof(struct STRUCT,name) + (len) + 8) & ~7) -#define cache_entry_size(len) flexible_size(cache_entry,len) +#define cache_entry_size(len) (offsetof(struct cache_entry,name) + (len) + 1) #define ondisk_cache_entry_size(len) flexible_size(ondisk_cache_entry,len) #define ondisk_cache_entry_extended_size(len) flexible_size(ondisk_cache_entry_extended,len)