23 #if defined(ONIXS_CMEMDH_ENABLE_TRACING) 39 virtual void release() = 0;
42 virtual void* allocate(
size_t) = 0;
45 virtual void deallocate(
void*) = 0;
47 #if defined(ONIXS_CMEMDH_ENABLE_TRACING) 48 virtual void trace(std::ostream&) = 0;
73 template <
class Object>
87 template <
class Other>
108 template <
class Other>
110 : pool_(&other.memoryPool())
126 const_pointer
address(const_reference x)
const 135 return static_cast<pointer
>(pool_->allocate(qty *
sizeof(value_type)));
142 pool_->deallocate(block);
147 new (block) value_type(obj);
158 return static_cast<size_type
>(-1) /
sizeof(value_type);
168 template <
class Other>
180 template <
class Object,
class OtherObject>
186 template <
class Object,
class OtherObject>
void construct(pointer block, const value_type &obj)
const Object & const_reference
const Object * const_pointer
std::ptrdiff_t difference_type
#define ONIXS_CMEMDH_NULLPTR
void destroy(pointer obj)
MemoryPool()
Default initialization.
void deallocate(pointer block, size_type)
pointer address(reference obj) const
MemoryPoolAllocator & operator=(const MemoryPoolAllocator &other)
MemoryPoolAllocator(MemoryPool &memoryPool)
MemoryPoolAllocator & operator=(const MemoryPoolAllocator< Other > &other)
MemoryPool * makeMemoryPool(size_t, size_t, size_t, size_t)
Constructs a memory pool instance according to the given configuration.
#define ONIXS_CMEMDH_NAMESPACE_BEGIN
virtual ~MemoryPool()
Destruction is through descendants.
size_type max_size() const
MemoryPoolAllocator(const MemoryPoolAllocator< Other > &other)
#define ONIXS_CMEMDH_EXPORTED
MemoryPool & memoryPool() const
MemoryPoolAllocator< Other > other
bool operator==(const MemoryPoolAllocator< Object > &left, const MemoryPoolAllocator< OtherObject > &right)
bool operator!=(const MemoryPoolAllocator< Object > &left, const MemoryPoolAllocator< OtherObject > &right)
pointer allocate(size_type qty)
const_pointer address(const_reference x) const
MemoryPoolAllocator(const MemoryPoolAllocator &other)
#define ONIXS_CMEMDH_NAMESPACE_END