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