41#ifndef ATLALLOCATORS_ARENAHEAPSTLALLOCATOR
42#define ATLALLOCATORS_ARENAHEAPSTLALLOCATOR
75 const std::string& name =
"");
92template <
class T,
class VETO=T>
142 template <
class U,
class V>
203 template <
bool = true>
204 requires (!std::same_as<reference,const_reference>)
222 template <
bool = true>
223 requires (!std::same_as<reference,const_reference>)
245 template <class...
Args>
373 : public
std::allocator<T>
376 typedef std::allocator<T>
base;
405 template <
class U,
class V>
422 const std::string&
name()
const;
442 template <
class CONT>
475 template <
class U,
class V>
554template <
class T,
class VETO>
Heap-based allocator. See Arena.h for an overview of the arena-based memory allocators.
Define macros for attributes used to control the static checker.
#define ATLAS_THREAD_SAFE
Common base class for arena allocator classes.
Common functionality for block-oriented allocators.
base::difference_type difference_type
base::value_type value_type
Standard STL allocator typedefs.
ArenaAllocatorBase::Stats stats() const
Return the statistics block for this allocator.
const std::string & name() const
Return the name of this allocator.
static ArenaNonConstHeapSTLAllocator< T > get_allocator(CONT &c)
Return an allocator supporting non-const methods from a non-const container reference.
const ArenaBlockAllocatorBase * poolptr() const
Return a pointer to the underlying allocator (may be 0).
const ArenaBlockAllocatorBase * m_poolptr
Point at an underlying allocator from a different specialization.
base::size_type size_type
ArenaHeapSTLAllocator(const ArenaHeapSTLAllocator< U, V > &a)
Constructor from another ArenaHeapSTLAllocator.
ArenaHeapSTLAllocator(size_t nblock=1000, const std::string &name="")
Default constructor.
size_t nblock() const
Return the hinted number of objects allocated per block.
size_t m_nblock
Saved hinted number of objects per block.
std::string m_name
Saved allocator name.
ArenaHeapAllocator::initParams< T, false, true, true > Base
We take defaults from this.
ArenaAllocatorBase::Params params() const
Return an initialized parameters structure.
ArenaHeapSTLAllocator_initParams(size_t nblock=1000, const std::string &name="")
Constructor.
STL-style allocator wrapper for ArenaHeapAllocator.
pointer address(reference x) const
Convert a reference to an address.
bool operator!=(const ArenaHeapSTLAllocator &other) const
Inequality test.
pointer allocate(size_type n, const void *hint=0)
Allocate new objects.
size_type max_size() const
Return the maximum number of objects we can allocate at once.
std::false_type propagate_on_container_copy_assignment
When we assign to a container, the target should retain its allocator.
void construct(pointer p, Args &&... args)
ArenaHeapSTLAllocator(const ArenaHeapSTLAllocator &a)
Copy constructor.
std::true_type propagate_on_container_swap
ArenaHeapSTLAllocator & operator=(ArenaHeapSTLAllocator &&a)
Move assignment.
ArenaAllocatorBase::Stats stats() const
T * pointer
Standard STL allocator typedefs.
const T & const_reference
ArenaHeapSTLAllocator(size_t nblock=1000, const std::string &name="")
Default constructor.
std::true_type propagate_on_container_move_assignment
Move allocators on move/swap.
void deallocate(pointer, size_type n)
Deallocate objects.
ArenaHeapAllocator m_pool
const ArenaBlockAllocatorBase * poolptr() const
ArenaHeapSTLAllocator(ArenaHeapSTLAllocator &&a)
Move constructor.
ArenaHeapSTLAllocator select_on_container_copy_construction() const
Return allocator to use for a copy-constructed container.
void reserve(size_t size)
void swap(ArenaHeapSTLAllocator &a)
Swap.
ArenaHeapSTLAllocator(const ArenaHeapSTLAllocator< U, V > &a)
Constructor from another ArenaHeapSTLAllocator.
bool operator==(const ArenaHeapSTLAllocator &other) const
Equality test.
ptrdiff_t difference_type
const std::string & name() const
ArenaNonConstHeapSTLAllocator(const ArenaHeapSTLAllocator< U, V > &a, ArenaBlockAllocatorBase *poolptr_nc)
Constructor.
ArenaBlockAllocatorBase * m_poolptr_nc
Non-const pointer to the underlying allocator.
void protect()
Write-protect the memory managed by this allocator.
void unprotect()
Write-enable the memory managed by this allocator.
void reserve(size_t size)
Set the total number of elements cached by the allocator.
void erase()
Free all allocated elements and release memory back to the system.
void reset()
Free all allocated elements.
void maybeUnprotect(ArenaHeapSTLAllocator< T, VETO > &a)
Hook for unprotecting an arena.
Statistics for an allocator.
Helper to initialize a parameters structure.
Standard STL allocator rebinder.
ArenaHeapSTLAllocator< U, VETO > other
Standard STL allocator rebinder.
ArenaHeapSTLAllocator< U, T > other