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

@@ -416,12 +416,11 @@ namespace snmalloc
/**
* Moves the iterator on, and returns the current value.
*/
FreeObject::HeadPtr<BView, BQueue> take(const FreeListKey& key)
template<typename Domesticator>
FreeObject::HeadPtr<BView, BQueue>
take(const FreeListKey& key, Domesticator domesticate)
{
auto c = curr;
// TODO: Placeholder
auto domesticate = [](FreeObject::QueuePtr<BQueue> p)
SNMALLOC_FAST_PATH_LAMBDA { return p; };
auto next = curr->read_next(key, domesticate);
Aal::prefetch(next.unsafe_ptr());