alloc: pass rsize, not size, down to Mediumslab::alloc
When we get to CHERI, sizes derived from sizeclasses are always precisely representable, while other sizes may not be. This should induce no change in behavior without CHERI, except that we might PAL::zero slightly more memory this way.
This commit is contained in:
committed by
Nathaniel Wesley Filardo
parent
a1f17e6060
commit
c94e37f5fc
@@ -1289,8 +1289,8 @@ namespace snmalloc
|
||||
|
||||
if (slab != nullptr)
|
||||
{
|
||||
p =
|
||||
Mediumslab::alloc<zero_mem, typename MemoryProvider::Pal>(slab, size);
|
||||
p = Mediumslab::alloc<zero_mem, typename MemoryProvider::Pal>(
|
||||
slab, rsize);
|
||||
|
||||
if (Mediumslab::full(slab))
|
||||
sc->pop();
|
||||
@@ -1312,8 +1312,8 @@ namespace snmalloc
|
||||
|
||||
Mediumslab::init(slab, public_state(), sizeclass, rsize);
|
||||
chunkmap().set_slab(slab);
|
||||
p =
|
||||
Mediumslab::alloc<zero_mem, typename MemoryProvider::Pal>(slab, size);
|
||||
p = Mediumslab::alloc<zero_mem, typename MemoryProvider::Pal>(
|
||||
slab, rsize);
|
||||
|
||||
if (!Mediumslab::full(slab))
|
||||
sc->insert(slab);
|
||||
|
||||
Reference in New Issue
Block a user