58 other.m_blocks =
nullptr;
59 other.m_freeblocks =
nullptr;
60 other.m_stats.clear();
61 other.m_protected =
false;
69ArenaBlockAllocatorBase::operator=
79 other.m_blocks =
nullptr;
80 other.m_freeblocks =
nullptr;
81 other.m_stats.clear();
82 other.m_protected =
false;
125 if (size >
m_stats.elts.total) {
144 while (size <
m_stats.elts.total &&
153 m_stats.elts.total -= p->size();
Common functionality for block-oriented allocators.
A large memory block that gets carved into smaller uniform elements. See Arena.h for an overview of t...
Exceptions that can be thrown from AthAllocators.
virtual void reset()=0
Free all allocated elements.
Common functionality for block-oriented allocators.
virtual void reserve(size_t size) override
Set the total number of elements cached by the allocator.
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.
virtual void erase() override
Free all allocated elements and release memory back to the system.
virtual ~ArenaBlockAllocatorBase()
Destructor.
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.
void protect()
Write-protect the memory managed by this allocator.
ArenaBlock * m_blocks
The list of blocks currently in use.
virtual Stats stats() const override
Return the statistics block for this allocator.
Params m_params
The parameters for this allocator.
virtual const std::string & name() const override
Return the name of 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.
static void protectList(ArenaBlock *p)
Write-protect all blocks in a list.
static void destroyList(ArenaBlock *p, func_t *dtor)
Destroy all blocks in a list.
static void destroy(ArenaBlock *p, func_t *dtor)
Destroy a block.
static ArenaBlock * newBlock(size_t n, size_t elt_size, func_t *ctor)
Create a new block.
ArenaBlock *& link()
Return the link pointer of the block.
static void unprotectList(ArenaBlock *p)
Write-enable all blocks in a list.
size_t size() const
Return the number of elements in the block.
static size_t overhead()
Return the per-block memory overhead, in bytes.
Exception — Attempt to change protected arena.
void swap(ElementLinkVector< DOBJ > &lhs, ElementLinkVector< DOBJ > &rhs)
Statistics for an allocator.