Refactor use of sizeclasses (#415)
The primary aim for this refactor is to use a representation for sizeclasses that uniformly covers both large and small. This allows certain operations such as alloc_size and external_pointer to be uniformly implemented. The additional types make clear which kind of sizeclass is in use. This also tidies up the code for sizeclass based divisible by and modulus. It fixes a bug in rust_realloc that didn't correctly determine a realloc was required for large classes.
This commit is contained in:
committed by
GitHub
parent
02f36a4b31
commit
3d403aef7f
@@ -166,7 +166,7 @@ int main(int, char**)
|
||||
f(5);
|
||||
f(7);
|
||||
printf("\n");
|
||||
for (size_t exp = 1; exp < snmalloc::MAX_SIZECLASS_BITS; exp++)
|
||||
for (size_t exp = 1; exp < snmalloc::MAX_SMALL_SIZECLASS_BITS; exp++)
|
||||
{
|
||||
auto shifted = [exp](size_t v) { return v << exp; };
|
||||
|
||||
|
||||
Reference in New Issue
Block a user