1#ifndef StlPoolAllocator_Include_Guard
2#define StlPoolAllocator_Include_Guard
10#if ( (__GNUC__ == 4) && (__GNUC_MINOR__ >= 2) ) || ( __GNUC__ > 4 )
11#define RESIP_HAS_STATEFUL_ALLOCATOR_SUPPORT
27template<
typename T,
typename P>
39#ifdef RESIP_HAS_STATEFUL_ALLOCATOR_SUPPORT
44 StlPoolAllocator&
operator=(
const StlPoolAllocator& rhs)
103 return mPool->allocate(bytes);
105 return ::operator
new(bytes);
112 mPool->deallocate(ptr);
115 ::operator
delete(ptr);
122 return mPool->max_size();
124 return std::numeric_limits<size_type>::max()/
sizeof(T);
131 return mPool->max_size();
133 return std::numeric_limits<size_type>::max()/_sz;
A dirt-simple lightweight stl pool allocator meant for use in short-lifetime objects.
bool operator!=(const StlPoolAllocator &rhs) const
void * allocate_raw(size_type bytes)
size_type max_size() const
void deallocate(pointer ptr, size_type n)
void construct(pointer p, const_reference orig)
pointer allocate(size_type n, const void *hint=0)
const value_type & const_reference
const_pointer address(const_reference ref) const
const value_type * const_pointer
StlPoolAllocator(const StlPoolAllocator< U, P > &other)
void destroy(pointer ptr)
ptrdiff_t difference_type
pointer address(reference ref) const
size_type max_size(size_type _sz) const
StlPoolAllocator(P *pool=0)
StlPoolAllocator & operator=(const StlPoolAllocator &rhs)
StlPoolAllocator(const StlPoolAllocator &other)
bool operator==(const StlPoolAllocator &rhs) const
void deallocate_raw(void *ptr)
dcm! – add UnusedChecking(_enum) below;
StlPoolAllocator< U, P > other