|
ATLAS Offline Software
|
Go to the documentation of this file.
41 #ifndef ATLALLOCATORS_ARENAHEAPSTLALLOCATOR
42 #define ATLALLOCATORS_ARENAHEAPSTLALLOCATOR
76 const std::string&
name =
"");
93 template <
class T,
class VETO=T>
143 template <
class U,
class V>
371 : public std::allocator<T>
374 typedef std::allocator<T>
base;
383 template <
class U>
struct rebind {
403 template <
class U,
class V>
420 const std::string&
name()
const;
440 template <
class CONT>
473 template <
class U,
class V>
552 template <
class T,
class VETO>
562 #endif // ATLALLOCATORS_ARENAHEAPSTLALLOCATOR
pointer allocate(size_type n, const void *hint=0)
Allocate new objects.
ArenaAllocatorBase::Params params() const
Return an initialized parameters structure.
size_t m_nblock
Saved hinted number of objects per block.
ArenaHeapSTLAllocator< U, VETO > other
bool operator==(const ArenaHeapSTLAllocator &other) const
Equality test.
base::size_type size_type
void reset()
Free all allocated elements.
void protect()
Write-protect the memory managed by this allocator.
std::true_type propagate_on_container_move_assignment
Move allocators on move/swap.
STL-style allocator wrapper for ArenaHeapAllocator.
const T & const_reference
void reserve(size_t size)
Set the total number of elements cached by the allocator.
Standard STL allocator rebinder.
void maybeUnprotect(ArenaHeapSTLAllocator< T, VETO > &a)
Hook for unprotecting an arena.
ArenaHeapSTLAllocator_initParams(size_t nblock=1000, const std::string &name="")
Constructor.
void erase()
Free all allocated elements and release memory back to the system.
bool const RAWDATA *ch2 const
base::value_type value_type
Standard STL allocator typedefs.
ArenaHeapSTLAllocator select_on_container_copy_construction() const
Return allocator to use for a copy-constructed container.
ArenaHeapSTLAllocator(const ArenaHeapSTLAllocator< U, V > &a)
Constructor from another ArenaHeapSTLAllocator.
void deallocate(pointer, size_type n)
Deallocate objects.
T * pointer
Standard STL allocator typedefs.
Statistics for an allocator.
void construct(pointer p, Args &&... args)
Call the T constructor.
ArenaHeapSTLAllocator< U, T > other
base::difference_type difference_type
ArenaNonConstHeapSTLAllocator(const ArenaHeapSTLAllocator< U, V > &a, ArenaBlockAllocatorBase *poolptr_nc)
Constructor.
Common base class for arena allocator classes.
Initializer for pool allocator parameters.
ArenaHeapSTLAllocator(ArenaHeapSTLAllocator &&a)
Move constructor.
pointer address(reference x) const
Convert a reference to an address.
const std::string & name() const
Return the name of this allocator.
void reserve(size_t size)
Set the total number of elements cached by the allocator.
const std::string & name() const
Return the name of this allocator.
ArenaAllocatorBase::Stats stats() const
Return the statistics block for this allocator.
ATH_MEMBER_REQUIRES(!(std::is_same_v< reference, const_reference >), const_pointer) address(const_reference x) const
Common functionality for block-oriented allocators.
ArenaHeapSTLAllocator(size_t nblock=1000, const std::string &name="")
Default constructor.
bool operator!=(const ArenaHeapSTLAllocator &other) const
Inequality test.
void erase()
Free all allocated elements and release memory back to the system.
size_t nblock() const
Return the hinted number of objects allocated per block.
ArenaHeapAllocator m_pool
The underlying allocator.
ArenaHeapSTLAllocator & operator=(ArenaHeapSTLAllocator &&a)
Move assignment.
ptrdiff_t difference_type
std::true_type propagate_on_container_swap
const ArenaBlockAllocatorBase * m_poolptr
Point at an underlying allocator from a different specialization.
void destroy(pointer p)
Call the T destructor.
Compatibility helpers for using some pieces of C++20 concepts with older compilers.
ArenaAllocatorBase::Stats stats() const
Return the statistics block for this allocator.
void reset()
Free all allocated elements.
Helper to initialize a parameters structure.
void protect()
Write-protect the memory managed by 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).
ArenaHeapSTLAllocator(size_t nblock=1000, const std::string &name="")
Default constructor.
std::string m_name
Saved allocator name.
#define ATLAS_THREAD_SAFE
std::false_type propagate_on_container_copy_assignment
When we assign to a container, the target should retain its allocator.
ArenaHeapSTLAllocator(const ArenaHeapSTLAllocator &a)
Copy constructor.
Define macros for attributes used to control the static checker.
ArenaHeapSTLAllocator(const ArenaHeapSTLAllocator< U, V > &a)
Constructor from another ArenaHeapSTLAllocator.
void unprotect()
Write-enable the memory managed by this allocator.
const ArenaBlockAllocatorBase * poolptr() const
Return a pointer to the underlying allocator (may be 0).
ArenaHeapAllocator::initParams< T, false, true, true > Base
We take defaults from this.
void unprotect()
Write-enable the memory managed by this allocator.
size_type max_size() const
Return the maximum number of objects we can allocate at once.
Heap-based allocator. See Arena.h for an overview of the arena-based memory allocators.
ArenaBlockAllocatorBase * m_poolptr_nc
Non-const pointer to the underlying allocator.
void swap(ArenaHeapSTLAllocator &a)
Swap.
size_t nblock() const
Return the hinted number of objects allocated per block.