 |
ATLAS Offline Software
|
Go to the documentation of this file.
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;
144 ArenaPoolAllocator::operator=
147 if (
this != &
other) {
151 other.m_ptr =
nullptr;
152 other.m_end =
nullptr;
163 if (
this != &
other) {
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) {
const Params & params() const
Return this Allocator's parameters.
JetConstituentVector::iterator iterator
void refill()
Add more free elements to the pool.
ArenaBlock * m_blocks
The list of blocks currently in use.
Exception — Attempt to change memory protection failed.
pointer index(size_t i)
Return a pointer to element i in the block.
void resetTo(pointer p)
Reset pool back to a previous state.
ArenaBlock * getBlock()
Return an empty block, either newly-allocated or from the free list.
void increment()
Move the iterator forward.
Params m_params
The parameters for this allocator.
size_t eltSize() const
Return the size of the elements in the 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.
func_t * clear
Clear function for elements.
bool m_protected
Flag whether the arena has been protected.
void swap(ArenaPoolAllocator &other)
Swap.
size_t inuse
Number of items currently allocated by the application.
Stat blocks
Counts of blocks.
ArenaBlock *& link()
Return the link pointer of the block.
void func_t(pointer)
Type of functions for constructor, etc.
ArenaPoolAllocator::pointer ArenaPoolAllocator_iterator_increment(ArenaPoolAllocator::pointer base, ArenaBlock *&block)
Helper: common code for advancing an iterator.
pointer m_end
One past the last available element in the current block, of null.
void clearBlock()
Reset all elements in the topmost block, and move the block to the free list.
size_t size() const
Return the number of elements in the block.
pointer m_ptr
Pointer to the next free element to allocate, or null.
void eraseUnprotected()
Free all allocated elements and release memory back to the system.
Common functionality for block-oriented allocators.
Non-const iterator for the pool.
ArenaBlock * m_block
Block containing the current element.
A large memory block that gets carved into smaller uniform elements.
iterator begin()
Starting pool iterator.
Pool-based allocator. See Arena.h for an overview of the arena-based memory allocators.
virtual void reset() override
Free all allocated elements.
ArenaBlockAllocatorBase & operator=(const ArenaBlockAllocatorBase &)=delete
void increment()
Move the iterator forward.
virtual void erase() override final
Free all allocated elements and release memory back to the system.
ArenaPoolAllocator(const Params ¶ms)
Constructor.
const char * const_pointer
And a const version of the pointer.
ArenaAllocatorBase::Stats m_stats
The statistics structure.
void unprotect()
Write-enable the memory managed by this allocator.
virtual ~ArenaPoolAllocator()
Destructor.
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.
char * pointer
Type for pointers to elements.
Exceptions that can be thrown from AthAllocators.
iterator end()
Ending pool iterator.
Const iterator for the pool.
A large memory block that gets carved into smaller uniform elements. See Arena.h for an overview of t...
Stat elts
Counts of elements.