21#include <dispenso/platform.h>
28template <
bool kThreadSafe>
50 DISPENSO_DLL_ACCESS
char*
alloc();
64 DISPENSO_DLL_ACCESS
void clear();
71 return (backingAllocs2_.size() + backingAllocs_.size()) * chunksPerAlloc_;
79 const size_t chunkSize_;
80 const size_t allocSize_;
81 const size_t chunksPerAlloc_;
83 std::function<
void*(
size_t)> allocFunc_;
84 std::function<
void(
void*)> deallocFunc_;
87 alignas(kCacheLineSize) std::atomic<uint32_t> backingAllocLock_{0};
88 std::vector<char*> backingAllocs_;
89 std::vector<char*> backingAllocs2_;
91 std::vector<char*> chunks_;
94using PoolAllocator = PoolAllocatorT<true>;
95using NoLockPoolAllocator = PoolAllocatorT<false>;
DISPENSO_DLL_ACCESS char * alloc()
DISPENSO_DLL_ACCESS void clear()
DISPENSO_DLL_ACCESS ~PoolAllocatorT()
size_t totalChunkCapacity() const
DISPENSO_DLL_ACCESS void dealloc(char *ptr)
detail::OpResult< T > OpResult