NFC: bump pointers have just one associated Slab
Rather than ::get()-ing the `Superslab` and `Slab` for each object we just created from the bump pointer, recognize that these objects necessarily come from the same `Slab` (and so the same `Superslab`). In the eventuality of CHERI, this means we'll amplify once per bump pointer, not once per created object.
This commit is contained in:
committed by
Matthew Parkinson
parent
1549e40705
commit
486ef10c21
@@ -750,15 +750,15 @@ namespace snmalloc
|
|||||||
auto& bp = bump_ptrs[i];
|
auto& bp = bump_ptrs[i];
|
||||||
auto rsize = sizeclass_to_size(i);
|
auto rsize = sizeclass_to_size(i);
|
||||||
FreeListIter ffl;
|
FreeListIter ffl;
|
||||||
|
|
||||||
|
Superslab* super = Superslab::get(bp);
|
||||||
|
Slab* slab = Metaslab::get_slab(bp);
|
||||||
while (pointer_align_up(bp, SLAB_SIZE) != bp)
|
while (pointer_align_up(bp, SLAB_SIZE) != bp)
|
||||||
{
|
{
|
||||||
Slab::alloc_new_list(bp, ffl, rsize);
|
Slab::alloc_new_list(bp, ffl, rsize);
|
||||||
while (!ffl.empty())
|
while (!ffl.empty())
|
||||||
{
|
{
|
||||||
auto curr = ffl.take();
|
small_dealloc_offseted_inner(super, slab, ffl.take(), i);
|
||||||
Superslab* super = Superslab::get(curr);
|
|
||||||
Slab* slab = Metaslab::get_slab(curr);
|
|
||||||
small_dealloc_offseted_inner(super, slab, curr, i);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user