41 : mBaseAllocator(baseAllocator)
49 : std::allocator<T>(other), mBaseAllocator(other.mBaseAllocator)
58 : std::allocator<T>(other), mBaseAllocator(other.mBaseAllocator)
70 =
reinterpret_cast<pointer>(mBaseAllocator.allocate(n *
sizeof(T)));
76 throw std::bad_alloc();
86 mBaseAllocator.deallocate(
pointer, n *
sizeof(T));
95 os <<
"[StlAllocator]\n";
97 const std::string spaces(indent,
' ');
98 os << spaces <<
"base_allocator:\n";
99 mBaseAllocator.print(os, indent + 2);
Base class for std::allocator compatible allocators.
Definition MemoryAllocator.hpp:46
Wrapper class for MemoryAllocator to be compatible with std::allocator.
Definition StlAllocator.hpp:45
void print(std::ostream &os=std::cout, int indent=0) const
Prints state of the memory allocator.
Definition StlAllocator-impl.hpp:91
friend class StlAllocator
Definition StlAllocator.hpp:103
typename std::allocator_traits< Base >::size_type size_type
Definition StlAllocator.hpp:50
typename std::allocator_traits< Base >::pointer pointer
Definition StlAllocator.hpp:51
void deallocate(pointer pointer, size_type n)
Deallocates the storage referenced by the pointer p, which must be a pointer obtained by an earlier c...
Definition StlAllocator-impl.hpp:84
pointer allocate(size_type n, const void *hint=0)
Allocates n * sizeof(T) bytes of uninitialized storage.
Definition StlAllocator-impl.hpp:65
std::ostream & operator<<(std::ostream &os, const StlAllocator< T > &allocator)
Definition StlAllocator-impl.hpp:104