Loading [MathJax]/extensions/tex2jax.js
 |
ATLAS Offline Software
|
Go to the documentation of this file.
52 #ifndef ATLALLOCATORS_ARENAPOOLSTLALLOCATOR
53 #define ATLALLOCATORS_ARENAPOOLSTLALLOCATOR
59 #include <type_traits>
87 const std::string&
name =
"");
104 template <
class T,
class VETO=T>
154 template <
class U,
class V>
216 template <
bool = true>
217 requires (!std::same_as<reference,const_reference>)
364 : public std::allocator<T*>
367 typedef std::allocator<T*>
base;
376 template <
class U>
struct rebind {
396 template <
class U,
class V>
413 const std::string&
name()
const;
448 :
public std::allocator<T>
451 typedef std::allocator<T>
base;
460 template <
class U>
struct rebind {
480 template <
class U,
class V>
497 const std::string&
name()
const;
517 template <
class CONT>
551 template <
class U,
class V>
630 template <
class T,
class VETO>
640 #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.
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.
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.
requires(!std::same_as< reference, const_reference >) const _pointer address(const_reference x) const
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.
ArenaBlockAllocatorBase * m_poolptr_nc
Non-const pointer to the underlying allocator.
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