38 block = block->
link();
63 block = block->
link();
76 this->base_reference() =
88 this->base_reference() =
base;
134 other.m_ptr =
nullptr;
136 other.m_end =
nullptr;
144ArenaPoolAllocator::operator=
147 if (
this != &other) {
151 other.m_ptr =
nullptr;
152 other.m_end =
nullptr;
163 if (
this != &other) {
187 assert (
m_stats.elts.inuse == 0);
188 assert (
m_ptr ==
nullptr);
189 assert (
m_end ==
nullptr);
223 assert (p !=
nullptr);
224 size_t elt_size = p->eltSize();
225 while (p && !(blk >= p->index(0, elt_size) &&
226 blk < p->
index(p->size(), elt_size)))
233 assert (p !=
nullptr);
237 if (blk == p->index(0, elt_size)) {
246 while (
m_ptr > blk) {
253 assert (
m_ptr == blk);
337 size_t elt_size = p->eltSize();
347 while (elt <
m_ptr) {
A large memory block that gets carved into smaller uniform elements. See Arena.h for an overview of t...
Pool-based allocator. See Arena.h for an overview of the arena-based memory allocators.
Exceptions that can be thrown from AthAllocators.
char * pointer
Type for pointers to elements.
void func_t(pointer)
Type of functions for constructor, etc.
const char * const_pointer
And a const version of the pointer.
void unprotect()
Write-enable the memory managed by this allocator.
const Params & params() const
Return this Allocator's parameters.
ArenaBlock * getBlock()
Return an empty block, either newly-allocated or from the free list.
ArenaBlockAllocatorBase & operator=(const ArenaBlockAllocatorBase &)=delete
virtual void erase() override
Free all allocated elements and release memory back to the system.
void eraseUnprotected()
Free all allocated elements and release memory back to the system.
ArenaAllocatorBase::Stats m_stats
The statistics structure.
void swap(ArenaBlockAllocatorBase &other)
Swap.
ArenaBlockAllocatorBase(const Params ¶ms)
Constructor.
ArenaBlock * m_blocks
The list of blocks currently in use.
Params m_params
The parameters for this allocator.
ArenaBlock * m_freeblocks
The list of free blocks.
bool m_protected
Flag whether the arena has been protected.
A large memory block that gets carved into smaller uniform elements.
pointer index(size_t i)
Return a pointer to element i in the block.
ArenaBlock *& link()
Return the link pointer of the block.
size_t eltSize() const
Return the size of the elements in the block.
size_t size() const
Return the number of elements in the block.
Const iterator for the pool.
const ArenaBlock * m_block
Block containing the current element.
void increment()
Move the iterator forward.
Non-const iterator for the pool.
void increment()
Move the iterator forward.
ArenaBlock * m_block
Block containing the current element.
pointer m_end
One past the last available element in the current block, of null.
iterator begin()
Starting pool iterator.
virtual void reset() override
Free all allocated elements.
void resetTo(pointer p)
Reset pool back to a previous state.
void refill()
Add more free elements to the pool.
void clearBlock()
Reset all elements in the topmost block, and move the block to the free list.
virtual ~ArenaPoolAllocator()
Destructor.
pointer m_ptr
Pointer to the next free element to allocate, or null.
ArenaPoolAllocator(const Params ¶ms)
Constructor.
void swap(ArenaPoolAllocator &other)
Swap.
virtual void erase() override final
Free all allocated elements and release memory back to the system.
iterator end()
Ending pool iterator.
Exception — Attempt to change memory protection failed.
ArenaPoolAllocator::pointer ArenaPoolAllocator_iterator_increment(ArenaPoolAllocator::pointer base, ArenaBlock *&block)
Helper: common code for advancing an iterator.
void swap(ElementLinkVector< DOBJ > &lhs, ElementLinkVector< DOBJ > &rhs)