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:
Nathaniel Filardo
2021-03-19 13:49:40 +00:00
committed by Matthew Parkinson
parent 1549e40705
commit 486ef10c21

View File

@@ -750,15 +750,15 @@ namespace snmalloc
auto& bp = bump_ptrs[i];
auto rsize = sizeclass_to_size(i);
FreeListIter ffl;
Superslab* super = Superslab::get(bp);
Slab* slab = Metaslab::get_slab(bp);
while (pointer_align_up(bp, SLAB_SIZE) != bp)
{
Slab::alloc_new_list(bp, ffl, rsize);
while (!ffl.empty())
{
auto curr = ffl.take();
Superslab* super = Superslab::get(curr);
Slab* slab = Metaslab::get_slab(curr);
small_dealloc_offseted_inner(super, slab, curr, i);
small_dealloc_offseted_inner(super, slab, ffl.take(), i);
}
}
}