Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> writes: > +static inline size_t estimate_cache_size(size_t ondisk_size, unsigned int entries) > +{ > + long per_entry; > + > + per_entry = sizeof(struct cache_entry) - sizeof(struct ondisk_cache_entry); > + > + /* > + * Alignment can cause differences. This should be "alignof", but > + * since that's a gcc'ism, just use the size of a pointer. > + */ > + per_entry += sizeof(void *); > + return ondisk_size + entries*per_entry; > +} > + I wonder if the issue Dave Miller addressed with 69ae517541ed5ab7d4fdcd8f82a9b8bd949df347 (fast-import: fix unalinged allocation and access) applies here. commit 69ae517541ed5ab7d4fdcd8f82a9b8bd949df347 Author: David S. Miller <davem@xxxxxxxxxxxxx> Date: Fri Dec 14 20:39:16 2007 -0800 fast-import: fix unalinged allocation and access The specialized pool allocator fast-import uses aligned objects on the size of a pointer, which was not sufficient at least on Sparc. Instead, make the alignment for objects of type unitmax_t. Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx> Signed-off-by: Junio C Hamano <gitster@xxxxxxxxx> - To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html