|
ATLAS Offline Software
|
Go to the documentation of this file.
37 block = block->
link();
62 block = block->
link();
75 this->base_reference() =
87 this->base_reference() =
base;
124 other.m_ptr =
nullptr;
126 other.m_end =
nullptr;
134 ArenaPoolAllocator::operator=
137 if (
this != &
other) {
141 other.m_ptr =
nullptr;
142 other.m_end =
nullptr;
153 if (
this != &
other) {
178 assert (
m_ptr ==
nullptr);
179 assert (
m_end ==
nullptr);
213 assert (
p !=
nullptr);
214 size_t elt_size =
p->eltSize();
215 while (
p && !(blk >=
p->index(0, elt_size) &&
216 blk < p->
index(
p->size(), elt_size)))
223 assert (
p !=
nullptr);
227 if (blk ==
p->index(0, elt_size)) {
236 while (
m_ptr > blk) {
243 assert (
m_ptr == blk);
327 size_t elt_size =
p->eltSize();
337 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.
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.
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.
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.
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.
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.