NFC: Make config objects expose their PoolState types

Just introduce the alias publicly so we can grab it when checking concepts
This commit is contained in:
Nathaniel Wesley Filardo
2021-08-23 21:24:42 +01:00
committed by Nathaniel Wesley Filardo
parent 3c14a7ddf1
commit 2e1658fc53
2 changed files with 10 additions and 4 deletions

View File

@@ -14,11 +14,14 @@ namespace snmalloc
template<SNMALLOC_CONCEPT(ConceptPAL) PAL>
class FixedGlobals final : public BackendAllocator<PAL, true>
{
public:
using GlobalPoolState = PoolState<CoreAllocator<FixedGlobals>>;
private:
using Backend = BackendAllocator<PAL, true>;
inline static ChunkAllocatorState slab_allocator_state;
inline static PoolState<CoreAllocator<FixedGlobals>> alloc_pool;
inline static GlobalPoolState alloc_pool;
public:
static ChunkAllocatorState&
@@ -27,7 +30,7 @@ namespace snmalloc
return slab_allocator_state;
}
static PoolState<CoreAllocator<FixedGlobals>>& pool()
static GlobalPoolState& pool()
{
return alloc_pool;
}

View File

@@ -31,13 +31,16 @@ namespace snmalloc
*/
class Globals final : public BackendAllocator<Pal, false>
{
public:
using GlobalPoolState = PoolState<CoreAllocator<Globals>>;
private:
using Backend = BackendAllocator<Pal, false>;
SNMALLOC_REQUIRE_CONSTINIT
inline static ChunkAllocatorState slab_allocator_state;
SNMALLOC_REQUIRE_CONSTINIT
inline static PoolState<CoreAllocator<Globals>> alloc_pool;
inline static GlobalPoolState alloc_pool;
SNMALLOC_REQUIRE_CONSTINIT
inline static std::atomic<bool> initialised{false};
@@ -52,7 +55,7 @@ namespace snmalloc
return slab_allocator_state;
}
static PoolState<CoreAllocator<Globals>>& pool()
static GlobalPoolState& pool()
{
return alloc_pool;
}