18#ifndef ATLALLOCATORS_ARENAHEAPALLOCATOR_H
19#define ATLALLOCATORS_ARENAHEAPALLOCATOR_H
174 virtual void reset()
override;
185 virtual void erase() override final;
220#include "AthAllocators/ArenaHeapAllocator.icc"
Common functionality for block-oriented allocators.
char * pointer
Type for pointers to elements.
const Params & params() const
Return this Allocator's parameters.
ArenaBlockAllocatorBase(const Params ¶ms)
Constructor.
virtual const std::string & name() const override
Return the name of this allocator.
A large memory block that gets carved into smaller uniform elements.
ArenaHeapAllocator & operator=(const ArenaHeapAllocator &)=delete
virtual ~ArenaHeapAllocator()
Destructor.
void swap(ArenaHeapAllocator &other)
Swap.
pointer refill()
Add more free elements to the pool, and allocate a new element.
ArenaHeapAllocator(const ArenaHeapAllocator &)=delete
Don't allow copy construction or assignment.
void slowClear()
Call clear() for all allocated elements.
pointer m_freeptr
Pointer to the next free element.
pointer & link(pointer p) const
Return a reference to the link for an element.
void free(pointer p)
Free an element.
pointer allocate()
Allocate a new element.
virtual void erase() override final
Free all allocated elements and release memory back to the system.
virtual void reset() override
Free all allocated elements.
ArenaHeapAllocator(const Params ¶ms)
Constructor.
Helper to initialize a parameters structure.
ArenaAllocatorBase::initParams< T, clear, no_ctor, no_dtor > Base
initParams(size_t nblock=1000, const std::string &name="")
Constructor.
ArenaAllocatorBase::Params params() const
Return an initialized parameters structure.