aboutsummaryrefslogtreecommitdiff
path: root/cache.h
diff options
context:
space:
mode:
authorRené Scharfe <rene.scharfe@lsrfire.ath.cx>2011-10-25 20:00:04 +0200
committerJunio C Hamano <gitster@pobox.com>2011-10-26 15:25:59 -0700
commitee7825b58cd423ea63a215c59fc2b7c7a2878af5 (patch)
tree82c35b627d677305bbe7f78c78aaca791a1f9a08 /cache.h
parentdebed2a6291a29fd7b0e96f63fbf0142ed3280eb (diff)
downloadgit-ee7825b58cd423ea63a215c59fc2b7c7a2878af5.tar.gz
git-ee7825b58cd423ea63a215c59fc2b7c7a2878af5.tar.xz
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 <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'cache.h')
-rw-r--r--cache.h2
1 files changed, 1 insertions, 1 deletions
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)