From 2e1658fc53bbcfc58200629aa36f0c1020fe1562 Mon Sep 17 00:00:00 2001 From: Nathaniel Wesley Filardo Date: Mon, 23 Aug 2021 21:24:42 +0100 Subject: [PATCH] NFC: Make config objects expose their PoolState types Just introduce the alias publicly so we can grab it when checking concepts --- src/backend/fixedglobalconfig.h | 7 +++++-- src/backend/globalconfig.h | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/backend/fixedglobalconfig.h b/src/backend/fixedglobalconfig.h index 2e4473e..dcb6e9f 100644 --- a/src/backend/fixedglobalconfig.h +++ b/src/backend/fixedglobalconfig.h @@ -14,11 +14,14 @@ namespace snmalloc template class FixedGlobals final : public BackendAllocator { + public: + using GlobalPoolState = PoolState>; + private: using Backend = BackendAllocator; inline static ChunkAllocatorState slab_allocator_state; - inline static PoolState> alloc_pool; + inline static GlobalPoolState alloc_pool; public: static ChunkAllocatorState& @@ -27,7 +30,7 @@ namespace snmalloc return slab_allocator_state; } - static PoolState>& pool() + static GlobalPoolState& pool() { return alloc_pool; } diff --git a/src/backend/globalconfig.h b/src/backend/globalconfig.h index 1e1cd92..15c24bf 100644 --- a/src/backend/globalconfig.h +++ b/src/backend/globalconfig.h @@ -31,13 +31,16 @@ namespace snmalloc */ class Globals final : public BackendAllocator { + public: + using GlobalPoolState = PoolState>; + private: using Backend = BackendAllocator; SNMALLOC_REQUIRE_CONSTINIT inline static ChunkAllocatorState slab_allocator_state; SNMALLOC_REQUIRE_CONSTINIT - inline static PoolState> alloc_pool; + inline static GlobalPoolState alloc_pool; SNMALLOC_REQUIRE_CONSTINIT inline static std::atomic initialised{false}; @@ -52,7 +55,7 @@ namespace snmalloc return slab_allocator_state; } - static PoolState>& pool() + static GlobalPoolState& pool() { return alloc_pool; }