On Tue Apr 11 08:20:18 2023 +0000, Tatsuyuki Ishi wrote:
Something like that, I'd use a common `FREE_LIST_` prefix for all the
related defines, remove `FREE_LIST_MAX_LOG` which isn't very useful, and add a `C_ASSERT` to better show that the actual number of free lists. Done.
Note that apparently the induced heap size increase makes some tests
to fail, using only 2 bits seems to be an easy fix, as it reduces the number of free lists to ~64, but I don't know if that's still good enough? It does make a difference, malloc overhead halves from 1.3% to 0.6%, but if the test issue is annoying enough I think using only 2 bits is also fine. Thoughts?
I don't have any strong opinion, but if you want to keep 3 bits you'll have to adjust the test.
Imho using 2 bits would be good enough according to your numbers, while keeping the struct heap overhead slightly smaller, and avoid having to argue about the test, which passes on Windows.