diff --git a/src/mem/corealloc.h b/src/mem/corealloc.h index 8747941..af3b19f 100644 --- a/src/mem/corealloc.h +++ b/src/mem/corealloc.h @@ -43,13 +43,13 @@ namespace snmalloc * provided externally, then it must be set explicitly with * `init_message_queue`. */ - template + template class CoreAllocator : public std::conditional_t< SharedStateHandle::Options.CoreAllocIsPoolAllocated, Pooled>, NotPoolAllocated> { - template + template friend class LocalAllocator; /** diff --git a/src/mem/globalalloc.h b/src/mem/globalalloc.h index 674b7ae..2a0b9ca 100644 --- a/src/mem/globalalloc.h +++ b/src/mem/globalalloc.h @@ -5,7 +5,7 @@ namespace snmalloc { - template + template inline static void aggregate_stats(Stats& stats) { static_assert( @@ -24,7 +24,7 @@ namespace snmalloc } #ifdef USE_SNMALLOC_STATS - template + template inline static void print_all_stats(std::ostream& o, uint64_t dumpid = 0) { static_assert( @@ -41,7 +41,7 @@ namespace snmalloc } } #else - template + template inline static void print_all_stats(void*& o, uint64_t dumpid = 0) { UNUSED(o); @@ -49,7 +49,7 @@ namespace snmalloc } #endif - template + template inline static void cleanup_unused() { #ifndef SNMALLOC_PASS_THROUGH @@ -83,7 +83,7 @@ namespace snmalloc allocators are empty. If you don't pass a pointer to a bool, then will raise an error all the allocators are not empty. */ - template + template inline static void debug_check_empty(bool* result = nullptr) { #ifndef SNMALLOC_PASS_THROUGH @@ -153,7 +153,7 @@ namespace snmalloc #endif } - template + template inline static void debug_in_use(size_t count) { static_assert( diff --git a/src/mem/localalloc.h b/src/mem/localalloc.h index f263ab7..02c210c 100644 --- a/src/mem/localalloc.h +++ b/src/mem/localalloc.h @@ -59,7 +59,7 @@ namespace snmalloc * core allocator must be provided externally by invoking the `init` method * on this class *before* any allocation-related methods are called. */ - template + template class LocalAllocator { public: diff --git a/src/mem/pool.h b/src/mem/pool.h index f8245c5..057c9ba 100644 --- a/src/mem/pool.h +++ b/src/mem/pool.h @@ -23,7 +23,7 @@ namespace snmalloc { template< typename TT, - typename SharedStateHandle, + SNMALLOC_CONCEPT(ConceptBackendGlobals) SharedStateHandle, PoolState& get_state()> friend class Pool; @@ -42,7 +42,9 @@ namespace snmalloc * SingletonPoolState::pool is the default provider for the PoolState within * the Pool class. */ - template + template< + typename T, + SNMALLOC_CONCEPT(ConceptBackendGlobals) SharedStateHandle> class SingletonPoolState { /** @@ -113,7 +115,7 @@ namespace snmalloc */ template< typename T, - typename SharedStateHandle, + SNMALLOC_CONCEPT(ConceptBackendGlobals) SharedStateHandle, PoolState& get_state() = SingletonPoolState::pool> class Pool { diff --git a/src/mem/pooled.h b/src/mem/pooled.h index d5b988c..7b499fd 100644 --- a/src/mem/pooled.h +++ b/src/mem/pooled.h @@ -13,7 +13,7 @@ namespace snmalloc public: template< typename TT, - typename SharedStateHandle, + SNMALLOC_CONCEPT(ConceptBackendGlobals) SharedStateHandle, PoolState& get_state()> friend class Pool; template @@ -45,4 +45,4 @@ namespace snmalloc return result; } }; -} // namespace snmalloc \ No newline at end of file +} // namespace snmalloc diff --git a/src/mem/slaballocator.h b/src/mem/slaballocator.h index 9fb2119..31f6e94 100644 --- a/src/mem/slaballocator.h +++ b/src/mem/slaballocator.h @@ -75,7 +75,7 @@ namespace snmalloc class ChunkAllocator { public: - template + template static std::pair, Metaslab*> alloc_chunk( typename SharedStateHandle::LocalState& local_state, sizeclass_t sizeclass, @@ -130,7 +130,7 @@ namespace snmalloc return {slab, meta}; } - template + template SNMALLOC_SLOW_PATH static void dealloc( typename SharedStateHandle::LocalState& local_state, ChunkRecord* p, @@ -153,7 +153,10 @@ namespace snmalloc * Backend allocator may use guard pages and separate area of * address space to protect this from corruption. */ - template + template< + typename U, + SNMALLOC_CONCEPT(ConceptBackendGlobals) SharedStateHandle, + typename... Args> static U* alloc_meta_data( typename SharedStateHandle::LocalState* local_state, Args&&... args) {