CapPtr: shift free lists to Alloc bounds

This is incomplete, yet still more reflective of what's going on: we take the
exported pointers back from userspace and thread them directly into the free
lists.

So: move capptr_to_user_address_control to list construction time rather than
list consumption time.
This commit is contained in:
Nathaniel Wesley Filardo
2021-09-21 19:17:51 +01:00
committed by Nathaniel Wesley Filardo
parent 55cd5e87c0
commit 7e53a2e82a
7 changed files with 99 additions and 91 deletions

View File

@@ -25,10 +25,10 @@ namespace snmalloc
* Data-structure for building the free list for this slab.
*/
#ifdef SNMALLOC_CHECK_CLIENT
FreeListBuilder<true, capptr::bounds::AllocFull, capptr::bounds::AllocFull>
FreeListBuilder<true, capptr::bounds::Alloc, capptr::bounds::Alloc>
free_queue;
#else
FreeListBuilder<false, capptr::bounds::AllocFull, capptr::bounds::AllocFull>
FreeListBuilder<false, capptr::bounds::Alloc, capptr::bounds::Alloc>
free_queue;
#endif
@@ -155,10 +155,10 @@ namespace snmalloc
* available objects for this metaslab.
*/
static SNMALLOC_FAST_PATH
std::pair<FreeObject::QueuePtr<capptr::bounds::AllocFull>, bool>
std::pair<FreeObject::QueuePtr<capptr::bounds::Alloc>, bool>
alloc_free_list(
Metaslab* meta,
FreeListIter<capptr::bounds::AllocFull, capptr::bounds::AllocFull>&
FreeListIter<capptr::bounds::Alloc, capptr::bounds::Alloc>&
fast_free_list,
LocalEntropy& entropy,
sizeclass_t sizeclass)