Large alloc fix (#178)
* Improved malloc style tests Added comprehensive testing of realloc, and other minor improvements to reporting errors. * Fix realloc resizing for large sizeclasses. The rounding by sizeclass was incorrect for large allocation. This fixes that. * Ensure alloc_size is committed There is an awkward interaction between alloc_size and committing only what is requested. If the user assumes everything up to alloc_size is available, then we need to either store the more precise size for alloc_size to return or commit the whole 2^n range, so that alloc_size stays simple. This changes to just make the whole range committed. In the future, we might want to store a more precise size, so that the allocation can be sized more precisely. * Reduce size of objects.
This commit is contained in:
committed by
GitHub
parent
79ca9bdd9d
commit
c899ee7ab2
@@ -221,7 +221,7 @@ void test_external_pointer_large()
|
||||
|
||||
for (size_t i = 0; i < count; i++)
|
||||
{
|
||||
size_t b = snmalloc::bits::is64() ? 28 : 26;
|
||||
size_t b = SUPERSLAB_BITS + 3;
|
||||
size_t rand = r.next() & ((1 << b) - 1);
|
||||
size_t size = (1 << 24) + rand;
|
||||
total_size += size;
|
||||
|
||||
Reference in New Issue
Block a user