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

@@ -77,7 +77,7 @@ int main(int argc, char** argv)
test_calloc(0, 0, SUCCESS, false);
for (uint8_t sc = 0; sc < NUM_SIZECLASSES; sc++)
for (snmalloc::sizeclass_t sc = 0; sc < NUM_SIZECLASSES; sc++)
{
const size_t size = sizeclass_to_size(sc);
@@ -103,7 +103,7 @@ int main(int argc, char** argv)
for (size_t align = sizeof(size_t); align <= SUPERSLAB_SIZE; align <<= 1)
{
for (uint8_t sc = 0; sc < NUM_SIZECLASSES; sc++)
for (snmalloc::sizeclass_t sc = 0; sc < NUM_SIZECLASSES; sc++)
{
const size_t size = sizeclass_to_size(sc);
test_posix_memalign(size, align, SUCCESS, false);