Re-enabled generic Pool which uses ChunkAllocator. Allocator pool renamed to AllocPool.
This commit is contained in:
@@ -58,9 +58,12 @@ namespace snmalloc
|
||||
template<class SharedStateHandle>
|
||||
class LocalAllocator
|
||||
{
|
||||
using CoreAlloc = CoreAllocator<SharedStateHandle>;
|
||||
public:
|
||||
using StateHandle = SharedStateHandle;
|
||||
|
||||
private:
|
||||
using CoreAlloc = CoreAllocator<SharedStateHandle>;
|
||||
|
||||
// Free list per small size class. These are used for
|
||||
// allocation on the fast path. This part of the code is inspired by
|
||||
// mimalloc.
|
||||
@@ -375,7 +378,7 @@ namespace snmalloc
|
||||
// Initialise the global allocator structures
|
||||
ensure_init();
|
||||
// Grab an allocator for this thread.
|
||||
init(Pool<CoreAlloc>::template acquire<SharedStateHandle>(
|
||||
init(AllocPool<CoreAlloc>::template acquire<SharedStateHandle>(
|
||||
&(this->local_cache)));
|
||||
}
|
||||
|
||||
@@ -398,7 +401,7 @@ namespace snmalloc
|
||||
// Return underlying allocator to the system.
|
||||
if constexpr (SharedStateHandle::Options.CoreAllocOwnsLocalState)
|
||||
{
|
||||
Pool<CoreAlloc>::template release<SharedStateHandle>(core_alloc);
|
||||
AllocPool<CoreAlloc>::template release<SharedStateHandle>(core_alloc);
|
||||
}
|
||||
|
||||
// Set up thread local allocator to look like
|
||||
|
||||
Reference in New Issue
Block a user