Moved SharedStateHandle to Pool class instead of methods since all of them use it

This commit is contained in:
Istvan Haller
2021-08-23 20:08:27 +01:00
parent c89a085c90
commit 769c61e716
4 changed files with 40 additions and 36 deletions

View File

@@ -380,8 +380,7 @@ namespace snmalloc
// Initialise the global allocator structures
ensure_init();
// Grab an allocator for this thread.
init(Pool<CoreAlloc>::template acquire<SharedStateHandle>(
&(this->local_cache)));
init(Pool<CoreAlloc, SharedStateHandle>::acquire(&(this->local_cache)));
}
// Return all state in the fast allocator and release the underlying
@@ -403,7 +402,7 @@ namespace snmalloc
// Return underlying allocator to the system.
if constexpr (SharedStateHandle::Options.CoreAllocOwnsLocalState)
{
Pool<CoreAlloc>::template release<SharedStateHandle>(core_alloc);
Pool<CoreAlloc, SharedStateHandle>::release(core_alloc);
}
// Set up thread local allocator to look like