On Sat, May 22, 2004 at 10:02:25AM +0200, Manfred Spraul wrote:No, 16373 must fail: After adding 12 bytes the object size would be 16385, which would mean an order==3 allocation.
Why this change? I've tested my fls(size-1)==fls(size-1-3*4) approach and it always returned the right result: No redzoning between 8181 and 8192 bytes, between 16373 and 16384, etc.
It returns a false positive when size + 3*BYTES_PER_WORD == 2**n, e.g.
size == 16373. Here, fls(size - 1) == 13, but fls(size - 1 + 12) == 13
while size - 1 + 12 == 16384, where we'd want the check to fail.