Minor nit; Use xcalloc() instead. It initializes the allocated area
to zero by default, either by the glibc allocator when it re-uses old
memory, or by the kernel when it's handed to userspace. It's a
micro-optimization, but a worthwhile one imo, especially for repos
with lots and lots of packs (git gc --auto runs galore).
The "calloc() returns nulified memory" dogma conforms to C89 and is
thus about as portable as it gets.
Andreas Ericsson email@example.com
OP5 AB www.op5.se
Tel: +46 8-230225 Fax: +46 8-230231