NFC: FreeListIter domestication plumbing

Just an intermediate syntactic step to chase dependencies.  All these introduced
"domestication" callbacks are just the identity function, but they will let us
thread the LocalAlloc's handle to the Backend state down to where it's needed.
This commit is contained in:
Nathaniel Wesley Filardo
2021-09-13 20:56:34 +01:00
committed by Nathaniel Wesley Filardo
parent a34b7a5973
commit 7750676598
6 changed files with 42 additions and 20 deletions

View File

@@ -211,6 +211,9 @@ namespace snmalloc
SNMALLOC_FAST_PATH void* small_alloc(size_t size)
{
// SNMALLOC_ASSUME(size <= sizeclass_to_size(NUM_SIZECLASSES));
auto domesticate = [](FreeObject::QueuePtr<capptr::bounds::Alloc> p)
SNMALLOC_FAST_PATH_LAMBDA { return p; };
auto slowpath =
[&](
sizeclass_t sizeclass,
@@ -239,7 +242,7 @@ namespace snmalloc
};
return local_cache.template alloc<zero_mem, SharedStateHandle>(
size, slowpath);
domesticate, size, slowpath);
}
/**