Make all large allocations naturally aligned

This makes any large allocation naturally aligned to its size. This
means all alignment requests can be handled without checks.
This commit is contained in:
Matthew Parkinson
2020-01-28 14:17:20 +00:00
parent a90c060708
commit 6e8edefc99
5 changed files with 6 additions and 58 deletions

View File

@@ -108,7 +108,7 @@ int main(int argc, char** argv)
test_posix_memalign((size_t)-1, 0, EINVAL, true);
test_posix_memalign(OS_PAGE_SIZE, sizeof(uintptr_t) / 2, EINVAL, true);
for (size_t align = sizeof(uintptr_t); align <= SUPERSLAB_SIZE; align <<= 1)
for (size_t align = sizeof(uintptr_t); align <= SUPERSLAB_SIZE * 8; align <<= 1)
{
for (snmalloc::sizeclass_t sc = 0; sc < NUM_SIZECLASSES; sc++)
{