Loading [MathJax]/extensions/tex2jax.js
 |
ATLAS Offline Software
|
Go to the documentation of this file.
51 m_freeptr (
other.m_freeptr)
55 other.m_freeptr =
nullptr;
63 ArenaHeapAllocator::operator=
68 m_freeptr =
other.m_freeptr;
69 other.m_freeptr =
nullptr;
146 size_t sz = newblock->
size();
147 size_t elt_size = newblock->
eltSize();
148 for (
size_t i=1;
i <
sz;
i++) {
157 return newblock->
index (0, elt_size);
167 std::vector<pointer> free_ptrs;
170 free_ptrs.push_back (
p);
172 std::sort (free_ptrs.begin(), free_ptrs.end());
175 std::vector<ArenaBlock*> blocks;
177 blocks.push_back (
p);
179 std::sort (blocks.begin(), blocks.end());
189 for (; bi != bi_end; ++bi) {
192 size_t elt_size = bl.
eltSize();
193 for (
size_t i = 0;
i <
sz;
i++) {
195 if (
pi != pi_end &&
ptr == *
pi) {
const Params & params() const
Return this Allocator's parameters.
JetConstituentVector::iterator iterator
ArenaBlock * m_blocks
The list of blocks currently in use.
pointer index(size_t i)
Return a pointer to element i in the block.
ArenaBlock * getBlock()
Return an empty block, either newly-allocated or from the free list.
static void applyList(ArenaBlock *p, func_t *func, size_t n)
Call a function on elements in a list of blocks.
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.
static void appendList(ArenaBlock **headp, ArenaBlock *tail)
Concatenate two lists of blocks.
size_t inuse
Number of items currently allocated by the application.
Stat blocks
Counts of blocks.
void func_t(pointer)
Type of functions for constructor, etc.
void slowClear()
Call clear() for all allocated elements.
size_t size() const
Return the number of elements in the block.
virtual void erase() override final
Free all allocated elements and release memory back to the system.
void swap(ArenaHeapAllocator &other)
Swap.
virtual void reset() override
Free all allocated elements.
Common functionality for block-oriented allocators.
A large memory block that gets carved into smaller uniform elements.
ArenaBlockAllocatorBase & operator=(const ArenaBlockAllocatorBase &)=delete
pointer m_freeptr
Pointer to the next free element.
size_t total
Total number of items held by the allocator.
ArenaAllocatorBase::Stats m_stats
The statistics structure.
size_t linkOffset
Offset from the start of a free element to a pointer to be used by the allocator.
bool canReclear
If true, clear can be called more than once on a given element.
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.
pointer refill()
Add more free elements to the pool, and allocate a new element.
ArenaHeapAllocator(const Params ¶ms)
Constructor.
pointer & link(pointer p) const
Return a reference to the link for an element.
Heap-based allocator. See Arena.h for an overview of the arena-based memory allocators.
A large memory block that gets carved into smaller uniform elements. See Arena.h for an overview of t...
Stat elts
Counts of elements.
virtual ~ArenaHeapAllocator()
Destructor.