|
ATLAS Offline Software
|
Go to the documentation of this file.
28 m_freeblocks (nullptr),
52 : m_params (
other.m_params),
53 m_blocks (
other.m_blocks),
54 m_freeblocks (
other.m_freeblocks),
55 m_stats (
other.m_stats),
56 m_protected (
other.m_protected)
58 other.m_blocks =
nullptr;
59 other.m_freeblocks =
nullptr;
60 other.m_stats.clear();
61 other.m_protected =
false;
69 ArenaBlockAllocatorBase::operator=
74 m_params =
other.m_params;
75 m_blocks =
other.m_blocks;
76 m_freeblocks =
other.m_freeblocks;
77 m_stats =
other.m_stats;
78 m_protected =
other.m_protected;
79 other.m_blocks =
nullptr;
80 other.m_freeblocks =
nullptr;
81 other.m_stats.clear();
82 other.m_protected =
false;
const Params & params() const
Return this Allocator's parameters.
virtual void reserve(size_t size) override
Set the total number of elements cached by the allocator.
ArenaBlock * m_blocks
The list of blocks currently in use.
func_t * constructor
Constructor function for elements.
virtual ~ArenaBlockAllocatorBase()
Destructor.
ArenaBlock * getBlock()
Return an empty block, either newly-allocated or from the free list.
static void destroy(ArenaBlock *p, func_t *dtor)
Destroy a block.
size_t nblock
The number of elements we should allocate in a single block (hint only).
bool mustClear
If true, the clear call cannot be skipped before destructor.
Params m_params
The parameters for this allocator.
static size_t overhead()
Return the per-block memory overhead, in bytes.
static ArenaBlock * newBlock(size_t n, size_t elt_size, func_t *ctor)
Create a new block.
virtual void erase() override
Free all allocated elements and release memory back to the system.
size_t free
Number of items currently not allocated by the application but cached by the allocator.
virtual const std::string & name() const override
Return the name of this allocator.
func_t * clear
Clear function for elements.
bool m_protected
Flag whether the arena has been protected.
size_t inuse
Number of items currently allocated by the application.
Stat blocks
Counts of blocks.
static void unprotectList(ArenaBlock *p)
Write-enable all blocks in a list.
ArenaBlock *& link()
Return the link pointer of the block.
ArenaBlockAllocatorBase(const Params ¶ms)
Constructor.
void clear()
Reset to zero.
Statistics for an allocator.
virtual Stats stats() const override
Return the statistics block for this allocator.
size_t size() const
Return the number of elements in the block.
Common functionality for block-oriented allocators.
std::string name
The name of this allocator.
Common functionality for block-oriented allocators.
Exception — Attempt to change protected arena.
Stat bytes
Counts of bytes.
A large memory block that gets carved into smaller uniform elements.
size_t total
Total number of items held by the allocator.
ArenaAllocatorBase::Stats m_stats
The statistics structure.
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.
void unprotect()
Write-enable the memory managed by this allocator.
void swap(ArenaBlockAllocatorBase &other)
Swap.
ArenaBlock * m_freeblocks
The list of free blocks.
size_t eltSize
The size in bytes of the individual elements we're allocating.
void protect()
Write-protect the memory managed by this allocator.
virtual void reset()=0
Free all allocated elements.
Exceptions that can be thrown from AthAllocators.
A large memory block that gets carved into smaller uniform elements. See Arena.h for an overview of t...
func_t * destructor
Destructor function for elements.
Stat elts
Counts of elements.