Re: Fix object re-hashing
From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:19
Linus Torvalds [off-list ref] writes:
Anyway, if all this makes you nervous,...
I did draw an illustration like the one I sent in my previous message when I received the first patch from Johannes, and it was reasonably obvious to me that it was meant to redistribute about half of the existing entries to the upper area, always going upwards, so modulo that wraparound corner case you fixed, I think doubling is fine.
Btw, as it currently stands, I worry a tiny tiny bit about the obj_allocs = (obj_allocs < 32 ? 32 : 2 * obj_allocs) thing, because I think that second "32" needs to be a "64" to be really safe (ie guarantee that the new obj_allocs value is always at least twice the old one).
obj_allocs starts out as 0 so the first value it gets is 32 when you need to insert the first element.