Made a sizecass_t to wrap the sizeclass

This is useful as codegen is nicer if we use size_t, but the semantics
is uint8_t, and is stored as that in many places in the metadata.
Ultimately should introduce a wrapper to check this invariant.
This commit is contained in:
Matthew Parkinson
2019-06-26 17:40:26 +01:00
parent 830b06a616
commit 7a8eaec2cc
9 changed files with 81 additions and 69 deletions

View File

@@ -137,7 +137,7 @@ extern "C"
}
size = bits::max(size, alignment);
uint8_t sc = size_to_sizeclass(size);
snmalloc::sizeclass_t sc = size_to_sizeclass(size);
if (sc >= NUM_SIZECLASSES)
{
// large allocs are 16M aligned.