From: Stefan Beller Date: Wed, 26 Apr 2017 23:01:27 GMT Subject: Re: [PATCH 35/53] Convert the verify_pack callback to struct object_id Message-ID: In-Reply-To: <20170423213453.253425-36-sandals@crustytoothpaste.net> On Sun, Apr 23, 2017 at 2:34 PM, brian m. carlson wrote: > Make the verify_pack_callback take a pointer to struct object_id. Use a > struct object_id to hold the pack checksum, even though it is not > strictly an object ID. Doing so ensures resilience against future hash > size changes, and allows us to remove hard-coded assumptions about how > big the buffer needs to be. > > Also, use a union to convert the pointer from nth_packed_object_sha1 to > to a pointer to struct object_id. This behavior is compatible with GCC > and clang and explicitly sanctioned by C11. The alternatives are to > just perform a cast, which would run afoul of strict aliasing rules, but > should just work, and changing the pointer into an instance of struct > object_id and copying the value. The latter operation could seriously > bloat memory usage on fsck, which already uses a lot of memory on some > repositories. > > Signed-off-by: brian m. carlson > --- Up to here *excluding* this one, looking good. This one may need review by an expert specialized in weird corner cases, which I am not, yet. ;) Thanks, Stefan