ATLAS Offline Software
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
SG::ArenaPoolAllocator Class Reference

Pool-based allocator. More...

#include <ArenaPoolAllocator.h>

Inheritance diagram for SG::ArenaPoolAllocator:
Collaboration diagram for SG::ArenaPoolAllocator:

Classes

class  const_iterator
 Const iterator for the pool. More...
 
class  iterator
 Non-const iterator for the pool. More...
 

Public Types

typedef char * pointer
 Type for pointers to elements. More...
 
typedef const char * const_pointer
 And a const version of the pointer. More...
 
typedef void func_t(pointer)
 Type of functions for constructor, etc. More...
 

Public Member Functions

 ArenaPoolAllocator (const Params &params)
 Constructor. More...
 
virtual ~ArenaPoolAllocator ()
 Destructor. More...
 
 ArenaPoolAllocator (const ArenaPoolAllocator &)=delete
 Don't allow copy construction or assignment. More...
 
ArenaPoolAllocatoroperator= (const ArenaPoolAllocator &)=delete
 
 ArenaPoolAllocator (ArenaPoolAllocator &&other)
 Move constructor. More...
 
ArenaPoolAllocatoroperator= (ArenaPoolAllocator &&other)
 Move assignment. More...
 
void swap (ArenaPoolAllocator &other)
 Swap. More...
 
pointer allocate ()
 Allocate a new element. More...
 
virtual void reset () override
 Free all allocated elements. More...
 
virtual void erase () override final
 Free all allocated elements and release memory back to the system. More...
 
void resetTo (pointer p)
 Reset pool back to a previous state. More...
 
iterator begin ()
 Starting pool iterator. More...
 
const_iterator begin () const
 Starting pool const iterator. More...
 
iterator end ()
 Ending pool iterator. More...
 
const_iterator end () const
 Ending pool const iterator. More...
 
void swap (ArenaBlockAllocatorBase &other)
 Swap. More...
 
virtual void reserve (size_t size) override
 Set the total number of elements cached by the allocator. More...
 
virtual Stats stats () const override
 Return the statistics block for this allocator. More...
 
virtual const std::string & name () const override
 Return the name of this allocator. More...
 
const Paramsparams () const
 Return this Allocator's parameters. More...
 
void protect ()
 Write-protect the memory managed by this allocator. More...
 
void unprotect ()
 Write-enable the memory managed by this allocator. More...
 
virtual void report (std::ostream &os) const
 Generate a report on the memory usage of this allocator. More...
 

Static Public Member Functions

template<class T >
static func_tmakeConstructor (const std::false_type &)
 Make a constructor function pointer for a non-trivial constructor. More...
 
template<class T >
static func_tmakeConstructor (const std::true_type &)
 Make a constructor function pointer for a trivial constructor. More...
 
template<class T >
static func_tmakeDestructor (const std::false_type &)
 Make a constructor function pointer for a non-trivial destructor. More...
 
template<class T >
static func_tmakeDestructor (const std::true_type &)
 Make a constructor function pointer for a trivial destructor. More...
 
template<class T >
static func_tmakeClear (const std::false_type &)
 Make a function pointer for a clear function. More...
 
template<class T >
static func_tmakeClear (const std::true_type &)
 Make a dummy clear function pointer. More...
 

Protected Member Functions

ArenaBlockgetBlock ()
 Return an empty block, either newly-allocated or from the free list. More...
 

Protected Attributes

Params m_params
 The parameters for this allocator. More...
 
ArenaBlockm_blocks
 The list of blocks currently in use. More...
 
ArenaBlockm_freeblocks
 The list of free blocks. More...
 
ArenaAllocatorBase::Stats m_stats
 The statistics structure. More...
 
bool m_protected
 Flag whether the arena has been protected. More...
 

Private Member Functions

void refill ()
 Add more free elements to the pool. More...
 
void clearBlock ()
 Reset all elements in the topmost block, and move the block to the free list. More...
 

Static Private Member Functions

template<typename T >
static void construct_fcn (pointer p)
 Call T's default constructor on the object at p. More...
 
template<typename T >
static void destroy_fcn (pointer p)
 Call T's destructor on the object at p. More...
 
template<typename T >
static void clear_fcn (pointer p)
 Call T::clear on the object at p. More...
 

Private Attributes

pointer m_ptr
 Pointer to the next free element to allocate, or null. More...
 
pointer m_end
 One past the last available element in the current block, of null. More...
 

Detailed Description

Pool-based allocator.

See Arena.h for an overview of the arena-based memory allocators.

This is a block-based memory allocator, with stack-like behavior (like the DataPool class). We do not allow freeing individual elements; instead, we support resetTo(p), which frees and all elements allocated after it (in this allocator). We also implement an iterator over the allocated blocks.

Definition at line 38 of file ArenaPoolAllocator.h.

Member Typedef Documentation

◆ const_pointer

And a const version of the pointer.

Definition at line 140 of file ArenaAllocatorBase.h.

◆ func_t

typedef void SG::ArenaAllocatorBase::func_t(pointer)
inherited

Type of functions for constructor, etc.

Definition at line 143 of file ArenaAllocatorBase.h.

◆ pointer

typedef char* SG::ArenaAllocatorBase::pointer
inherited

Type for pointers to elements.

Definition at line 137 of file ArenaAllocatorBase.h.

Constructor & Destructor Documentation

◆ ArenaPoolAllocator() [1/3]

SG::ArenaPoolAllocator::ArenaPoolAllocator ( const Params params)

Constructor.

Parameters
paramsThe parameters structure for this allocator. See ArenaAllocatorBase.h for the contents.

Definition at line 96 of file ArenaPoolAllocator.cxx.

98  m_ptr (nullptr),
99  m_end (nullptr)
100 {
101 }

◆ ~ArenaPoolAllocator()

SG::ArenaPoolAllocator::~ArenaPoolAllocator ( )
virtual

Destructor.

This will free all the Allocator's storage.

Definition at line 107 of file ArenaPoolAllocator.cxx.

108 {
109  erase();
110 }

◆ ArenaPoolAllocator() [2/3]

SG::ArenaPoolAllocator::ArenaPoolAllocator ( const ArenaPoolAllocator )
delete

Don't allow copy construction or assignment.

◆ ArenaPoolAllocator() [3/3]

SG::ArenaPoolAllocator::ArenaPoolAllocator ( ArenaPoolAllocator &&  other)

Move constructor.

Definition at line 116 of file ArenaPoolAllocator.cxx.

118  : ArenaBlockAllocatorBase (std::move (other)),
119  m_ptr (other.m_ptr),
120  m_end (other.m_end)
121 {
122  // False positives
123  // cppcheck-suppress useInitializationList
124  other.m_ptr = nullptr;
125  // cppcheck-suppress useInitializationList
126  other.m_end = nullptr;
127 }

Member Function Documentation

◆ allocate()

pointer SG::ArenaPoolAllocator::allocate ( )

Allocate a new element.

The fast path of this will be completely inlined.

◆ begin() [1/2]

ArenaPoolAllocator::iterator SG::ArenaPoolAllocator::begin ( )

Starting pool iterator.

This will iterate over all allocated elements (in unspecified order). It is a forward_iterator.

Definition at line 261 of file ArenaPoolAllocator.cxx.

262 {
263  // If @c m_ptr is one set, it is one more than the last allocated element.
264  return iterator (m_ptr ? m_ptr - m_params.eltSize : nullptr, m_blocks);
265 }

◆ begin() [2/2]

ArenaPoolAllocator::const_iterator SG::ArenaPoolAllocator::begin ( ) const

Starting pool const iterator.

This will iterate over all allocated elements (in unspecified order). It is a forward_iterator.

Definition at line 274 of file ArenaPoolAllocator.cxx.

275 {
276  // If @c m_ptr is one set, it is one more than the last allocated element.
277  return const_iterator (m_ptr ? m_ptr - m_params.eltSize : nullptr, m_blocks);
278 }

◆ clear_fcn()

template<typename T >
static void SG::ArenaAllocatorBase::clear_fcn ( pointer  p)
staticprivateinherited

Call T::clear on the object at p.

Parameters
pThe object on which to run the clear.

◆ clearBlock()

void SG::ArenaPoolAllocator::clearBlock ( )
private

Reset all elements in the topmost block, and move the block to the free list.

Definition at line 319 of file ArenaPoolAllocator.cxx.

320 {
321  // The topmost block.
322  ArenaBlock* p = m_blocks;
323 
324  // Nothing to do if there are no allocated blocks!
325  if (!p) return;
326 
327  size_t elt_size = p->eltSize();
328 
329  // The first element of the block.
330  pointer base = p->index(0, elt_size);
331 
332  // Do we need to call @c clear? If so, call it on all allocated elements
333  // in this block.
335  if (clear) {
336  pointer elt = base;
337  while (elt < m_ptr) {
338  clear (elt);
339  elt += elt_size;
340  }
341  }
342 
343  // Update statistics.
344  --m_stats.blocks.inuse;
345  ++m_stats.blocks.free;
346  m_stats.elts.inuse -= (m_ptr - base) / elt_size;
347 
348  // Move the block from the allocated to the free list.
349  m_blocks = p->link();
350  p->link() = m_freeblocks;
351  m_freeblocks = p;
352  p = m_blocks;
353 
354  // Reset the pointers.
355  if (p) {
356  m_ptr = m_end = p->index(p->size());
357  }
358  else {
359  m_ptr = m_end = nullptr;
360  }
361 }

◆ construct_fcn()

template<typename T >
static void SG::ArenaAllocatorBase::construct_fcn ( pointer  p)
staticprivateinherited

Call T's default constructor on the object at p.

Parameters
pThe object on which to run the constructor.

◆ destroy_fcn()

template<typename T >
static void SG::ArenaAllocatorBase::destroy_fcn ( pointer  p)
staticprivateinherited

Call T's destructor on the object at p.

Parameters
pThe object on which to run the destructor.

◆ end() [1/2]

ArenaPoolAllocator::iterator SG::ArenaPoolAllocator::end ( )

Ending pool iterator.

Definition at line 284 of file ArenaPoolAllocator.cxx.

285 {
286  // Use a null iterator to signal the end.
287  return iterator ();
288 }

◆ end() [2/2]

ArenaPoolAllocator::const_iterator SG::ArenaPoolAllocator::end ( ) const

Ending pool const iterator.

Definition at line 294 of file ArenaPoolAllocator.cxx.

295 {
296  // Use a null iterator to signal the end.
297  return const_iterator ();
298 }

◆ erase()

void SG::ArenaPoolAllocator::erase ( )
finaloverridevirtual

Free all allocated elements and release memory back to the system.

All elements allocated are freed, and all allocated blocks of memory are released back to the system. destructor should be called on them if it was provided (preceded by clear if provided and mustClear was set).

Reimplemented from SG::ArenaBlockAllocatorBase.

Definition at line 191 of file ArenaPoolAllocator.cxx.

192 {
193  // Delete all the blocks.
195 
196  // Reset pointers.
197  m_ptr = m_end = nullptr;
198 }

◆ getBlock()

ArenaBlock * SG::ArenaBlockAllocatorBase::getBlock ( )
protectedinherited

Return an empty block, either newly-allocated or from the free list.

Update statistics appropriately.

Definition at line 234 of file ArenaBlockAllocatorBase.cxx.

235 {
236  if (m_protected) {
237  throw SG::ExcProtected();
238  }
239 
240  ArenaBlock* newblock = m_freeblocks;
241  if (newblock) {
242  // There's something on the free list. Remove it and update statistics.
243  m_freeblocks = newblock->link();
244  --m_stats.blocks.free;
245  }
246  else {
247  // Otherwise, we need to make a new block.
250  m_stats.elts.total += newblock->size();
251  ++m_stats.blocks.total;
252  }
253  // Finish updating statistics.
254  // (Remaining ones are computed in stats().)
255  ++m_stats.blocks.inuse;
256 
257  // Link it into the in-use list and return.
258  newblock->link() = m_blocks;
259  m_blocks = newblock;
260  return newblock;
261 }

◆ makeClear() [1/2]

template<class T >
static func_t* SG::ArenaAllocatorBase::makeClear ( const std::false_type &  )
staticinherited

Make a function pointer for a clear function.

◆ makeClear() [2/2]

template<class T >
static func_t* SG::ArenaAllocatorBase::makeClear ( const std::true_type &  )
staticinherited

Make a dummy clear function pointer.

◆ makeConstructor() [1/2]

template<class T >
static func_t* SG::ArenaAllocatorBase::makeConstructor ( const std::false_type &  )
staticinherited

Make a constructor function pointer for a non-trivial constructor.

◆ makeConstructor() [2/2]

template<class T >
static func_t* SG::ArenaAllocatorBase::makeConstructor ( const std::true_type &  )
staticinherited

Make a constructor function pointer for a trivial constructor.

◆ makeDestructor() [1/2]

template<class T >
static func_t* SG::ArenaAllocatorBase::makeDestructor ( const std::false_type &  )
staticinherited

Make a constructor function pointer for a non-trivial destructor.

◆ makeDestructor() [2/2]

template<class T >
static func_t* SG::ArenaAllocatorBase::makeDestructor ( const std::true_type &  )
staticinherited

Make a constructor function pointer for a trivial destructor.

◆ name()

const std::string & SG::ArenaBlockAllocatorBase::name ( ) const
overridevirtualinherited

Return the name of this allocator.

Implements SG::ArenaAllocatorBase.

Definition at line 214 of file ArenaBlockAllocatorBase.cxx.

215 {
216  return m_params.name;
217 }

◆ operator=() [1/2]

ArenaPoolAllocator & SG::ArenaPoolAllocator::operator= ( ArenaPoolAllocator &&  other)

Move assignment.

Definition at line 134 of file ArenaPoolAllocator.cxx.

136 {
137  if (this != &other) {
139  m_ptr = other.m_ptr;
140  m_end = other.m_end;
141  other.m_ptr = nullptr;
142  other.m_end = nullptr;
143  }
144  return *this;
145 }

◆ operator=() [2/2]

ArenaPoolAllocator& SG::ArenaPoolAllocator::operator= ( const ArenaPoolAllocator )
delete

◆ params()

const ArenaAllocatorBase::Params & SG::ArenaBlockAllocatorBase::params ( ) const
inherited

Return this Allocator's parameters.

Return this allocator's parameters.

Definition at line 224 of file ArenaBlockAllocatorBase.cxx.

225 {
226  return m_params;
227 }

◆ protect()

void SG::ArenaBlockAllocatorBase::protect ( )
inherited

Write-protect the memory managed by this allocator.

Adjust protection on the memory managed by this allocator to disallow writes.

Definition at line 270 of file ArenaBlockAllocatorBase.cxx.

271 {
273  m_protected = true;
274 }

◆ refill()

void SG::ArenaPoolAllocator::refill ( )
private

Add more free elements to the pool.

Definition at line 304 of file ArenaPoolAllocator.cxx.

305 {
306  // Get a new block.
307  ArenaBlock* newblock = getBlock();
308 
309  // Set the pointers.
310  m_ptr = newblock->index (0, m_params.eltSize);
311  m_end = newblock->index (newblock->size(), m_params.eltSize);
312 }

◆ report()

void SG::ArenaAllocatorBase::report ( std::ostream &  os) const
virtualinherited

Generate a report on the memory usage of this allocator.

Parameters
osStream to which the report should be written.

Definition at line 131 of file ArenaAllocatorBase.cxx.

132 {
133  os << " " << stats() << " " << name() << std::endl;
134 }

◆ reserve()

void SG::ArenaBlockAllocatorBase::reserve ( size_t  size)
overridevirtualinherited

Set the total number of elements cached by the allocator.

Parameters
sizeThe desired pool size.

This allows changing the number of elements that are currently free but cached. Any allocated elements are not affected by this call.

If size is greater than the total number of elements currently cached, then more will be allocated. This will preferably done with a single block, but that is not guaranteed; in addition, the allocator may allocate more elements than is requested.

If size is smaller than the total number of elements currently cached, as many blocks as possible will be released back to the system. It may not be possible to release the number of elements requested; this should be implemented on a best-effort basis.

Implements SG::ArenaAllocatorBase.

Definition at line 120 of file ArenaBlockAllocatorBase.cxx.

121 {
122  if (m_protected) {
123  throw SG::ExcProtected();
124  }
125  if (size > m_stats.elts.total) {
126  // Growing the pool.
127  // Make a new block of the required size.
128  size_t sz = size - m_stats.elts.total;
129  ArenaBlock* newblock = ArenaBlock::newBlock (sz, m_params.eltSize,
131 
132  // Update statistics (others are derived in stats()).
133  ++m_stats.blocks.free;
134  ++m_stats.blocks.total;
135  m_stats.elts.total += newblock->size();
136 
137  // Add to the free list.
138  newblock->link() = m_freeblocks;
139  m_freeblocks = newblock;
140  }
141  else {
142  // Shrinking the pool.
143  // Loop while we can get rid of the first free block.
144  while (size < m_stats.elts.total &&
145  m_freeblocks &&
147  {
148  // Remove it from the free list.
149  ArenaBlock* p = m_freeblocks;
151 
152  // Update statistics (others are derived in stats()).
153  m_stats.elts.total -= p->size();
154  --m_stats.blocks.free;
155  --m_stats.blocks.total;
156 
157  // Free the block.
159  }
160  }
161 }

◆ reset()

void SG::ArenaPoolAllocator::reset ( )
overridevirtual

Free all allocated elements.

All elements allocated are returned to the free state. clear should be called on them if it was provided. The elements may continue to be cached internally, without returning to the system.

Implements SG::ArenaAllocatorBase.

Definition at line 169 of file ArenaPoolAllocator.cxx.

170 {
171  // Clear each block in turn.
172  while (m_blocks) {
173  clearBlock();
174  }
175 
176  // Check that things are consistent.
177  assert (m_stats.elts.inuse == 0);
178  assert (m_ptr == nullptr);
179  assert (m_end == nullptr);
180 }

◆ resetTo()

void SG::ArenaPoolAllocator::resetTo ( pointer  blk)

Reset pool back to a previous state.

Parameters
pThe pointer back to which to reset.

This will free (a la reset) the element p and all elements that have been allocated after it from this allocator.

Parameters
blkThe pointer back to which to reset.

This will free (a la reset) the element p and all elements that have been allocated after it from this allocator.

Definition at line 208 of file ArenaPoolAllocator.cxx.

209 {
210  // Clear the topmost block, as long as it doesn't contain the sought-after
211  // pointer.
212  ArenaBlock* p = m_blocks;
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)))
217  {
218  clearBlock();
219  p = m_blocks;
220  }
221 
222  // We'll trip this if the supplied pointer wasn't in any block.
223  assert (p != nullptr);
224 
225  // If the element is at the beginning of this block, just clear the whole
226  // thing.
227  if (blk == p->index(0, elt_size)) {
228  clearBlock();
229  }
230  else {
231  // Otherwise, we need to clear some of the elements in this block.
232  // See if we need to call @c clear.
234  if (clear) {
235  // Yeah, we do. Call @c clear on each element in turn.
236  while (m_ptr > blk) {
237  m_ptr -= elt_size;
238  clear (m_ptr);
239  --m_stats.elts.inuse;
240  }
241  // We'll trip this if the supplied pointer wasn't on an element
242  // boundary.
243  assert (m_ptr == blk);
244  }
245  else {
246  // We don't need to call @c clear.
247  // So we can do it the fast way --- just reset pointers.
248  m_stats.elts.inuse -= (m_ptr - blk) / elt_size;
249  m_ptr = blk;
250  }
251  }
252 }

◆ stats()

ArenaAllocatorBase::Stats SG::ArenaBlockAllocatorBase::stats ( ) const
overridevirtualinherited

Return the statistics block for this allocator.

Implements SG::ArenaAllocatorBase.

Definition at line 196 of file ArenaBlockAllocatorBase.cxx.

197 {
198  // Calculate derived statistics.
199  Stats stats = m_stats;
207  return stats;
208 }

◆ swap() [1/2]

void SG::ArenaBlockAllocatorBase::swap ( ArenaBlockAllocatorBase other)
inherited

Swap.

Definition at line 91 of file ArenaBlockAllocatorBase.cxx.

92 {
93  if (this != &other) {
94  std::swap (m_params, other.m_params);
95  std::swap (m_blocks, other.m_blocks);
96  std::swap (m_freeblocks, other.m_freeblocks);
97  std::swap (m_stats, other.m_stats);
98  std::swap (m_protected, other.m_protected);
99  }
100 }

◆ swap() [2/2]

void SG::ArenaPoolAllocator::swap ( ArenaPoolAllocator other)

Swap.

Definition at line 151 of file ArenaPoolAllocator.cxx.

152 {
153  if (this != &other) {
155  std::swap (m_ptr, other.m_ptr);
156  std::swap (m_end, other.m_end);
157  }
158 }

◆ unprotect()

void SG::ArenaBlockAllocatorBase::unprotect ( )
inherited

Write-enable the memory managed by this allocator.

Adjust protection on the memory managed by this allocator to allow writes.

Definition at line 283 of file ArenaBlockAllocatorBase.cxx.

284 {
285  if (m_protected) {
287  m_protected = false;
288  }
289 }

Member Data Documentation

◆ m_blocks

ArenaBlock* SG::ArenaBlockAllocatorBase::m_blocks
protectedinherited

The list of blocks currently in use.

Definition at line 153 of file ArenaBlockAllocatorBase.h.

◆ m_end

pointer SG::ArenaPoolAllocator::m_end
private

One past the last available element in the current block, of null.

Definition at line 266 of file ArenaPoolAllocator.h.

◆ m_freeblocks

ArenaBlock* SG::ArenaBlockAllocatorBase::m_freeblocks
protectedinherited

The list of free blocks.

Definition at line 156 of file ArenaBlockAllocatorBase.h.

◆ m_params

Params SG::ArenaBlockAllocatorBase::m_params
protectedinherited

The parameters for this allocator.

Definition at line 150 of file ArenaBlockAllocatorBase.h.

◆ m_protected

bool SG::ArenaBlockAllocatorBase::m_protected
protectedinherited

Flag whether the arena has been protected.

Definition at line 162 of file ArenaBlockAllocatorBase.h.

◆ m_ptr

pointer SG::ArenaPoolAllocator::m_ptr
private

Pointer to the next free element to allocate, or null.

Definition at line 263 of file ArenaPoolAllocator.h.

◆ m_stats

ArenaAllocatorBase::Stats SG::ArenaBlockAllocatorBase::m_stats
protectedinherited

The statistics structure.

Definition at line 159 of file ArenaBlockAllocatorBase.h.


The documentation for this class was generated from the following files:
SG::ArenaBlockAllocatorBase::params
const Params & params() const
Return this Allocator's parameters.
Definition: ArenaBlockAllocatorBase.cxx:224
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
base
std::string base
Definition: hcg.cxx:78
SG::ArenaBlockAllocatorBase::m_blocks
ArenaBlock * m_blocks
The list of blocks currently in use.
Definition: ArenaBlockAllocatorBase.h:153
SG::ArenaAllocatorBase::Params::constructor
func_t * constructor
Constructor function for elements.
Definition: ArenaAllocatorBase.h:170
SG::ArenaAllocatorBase::stats
virtual Stats stats() const =0
Return the statistics block for this allocator.
fitman.sz
sz
Definition: fitman.py:527
SG::ArenaBlockAllocatorBase::getBlock
ArenaBlock * getBlock()
Return an empty block, either newly-allocated or from the free list.
Definition: ArenaBlockAllocatorBase.cxx:234
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
SG::ArenaBlock::destroy
static void destroy(ArenaBlock *p, func_t *dtor)
Destroy a block.
Definition: ArenaBlock.cxx:69
SG::ArenaAllocatorBase::Params::nblock
size_t nblock
The number of elements we should allocate in a single block (hint only).
Definition: ArenaAllocatorBase.h:162
index
Definition: index.py:1
SG::ArenaBlockAllocatorBase::m_params
Params m_params
The parameters for this allocator.
Definition: ArenaBlockAllocatorBase.h:150
SG::ArenaBlock::overhead
static size_t overhead()
Return the per-block memory overhead, in bytes.
Definition: ArenaBlock.cxx:157
SG::ArenaBlock::newBlock
static ArenaBlock * newBlock(size_t n, size_t elt_size, func_t *ctor)
Create a new block.
Definition: ArenaBlock.cxx:41
SG::ArenaBlockAllocatorBase::erase
virtual void erase() override
Free all allocated elements and release memory back to the system.
Definition: ArenaBlockAllocatorBase.cxx:172
SG::ArenaAllocatorBase::Stats::Stat::free
size_t free
Number of items currently not allocated by the application but cached by the allocator.
Definition: ArenaAllocatorBase.h:205
SG::ArenaAllocatorBase::Params::clear
func_t * clear
Clear function for elements.
Definition: ArenaAllocatorBase.h:175
SG::ArenaBlockAllocatorBase::m_protected
bool m_protected
Flag whether the arena has been protected.
Definition: ArenaBlockAllocatorBase.h:162
SG::ArenaAllocatorBase::Stats::Stat::inuse
size_t inuse
Number of items currently allocated by the application.
Definition: ArenaAllocatorBase.h:202
SG::ArenaAllocatorBase::Stats::blocks
Stat blocks
Counts of blocks.
Definition: ArenaAllocatorBase.h:217
SG::ArenaBlock::unprotectList
static void unprotectList(ArenaBlock *p)
Write-enable all blocks in a list.
Definition: ArenaBlock.cxx:218
SG::ArenaBlock::link
ArenaBlock *& link()
Return the link pointer of the block.
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
SG::ArenaAllocatorBase::func_t
void func_t(pointer)
Type of functions for constructor, etc.
Definition: ArenaAllocatorBase.h:143
SG::ArenaBlockAllocatorBase::ArenaBlockAllocatorBase
ArenaBlockAllocatorBase(const Params &params)
Constructor.
Definition: ArenaBlockAllocatorBase.cxx:25
SG::ArenaPoolAllocator::m_end
pointer m_end
One past the last available element in the current block, of null.
Definition: ArenaPoolAllocator.h:266
SG::ArenaPoolAllocator::clearBlock
void clearBlock()
Reset all elements in the topmost block, and move the block to the free list.
Definition: ArenaPoolAllocator.cxx:319
SG::ArenaBlockAllocatorBase::stats
virtual Stats stats() const override
Return the statistics block for this allocator.
Definition: ArenaBlockAllocatorBase.cxx:196
SG::ArenaBlock::size
size_t size() const
Return the number of elements in the block.
SG::ArenaPoolAllocator::m_ptr
pointer m_ptr
Pointer to the next free element to allocate, or null.
Definition: ArenaPoolAllocator.h:263
WriteCalibToCool.swap
swap
Definition: WriteCalibToCool.py:94
SG::ArenaAllocatorBase::Params::name
std::string name
The name of this allocator.
Definition: ArenaAllocatorBase.h:152
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
SG::ExcProtected
Exception — Attempt to change protected arena.
Definition: Control/AthAllocators/AthAllocators/exceptions.h:58
SG::ArenaAllocatorBase::Stats::bytes
Stat bytes
Counts of bytes.
Definition: ArenaAllocatorBase.h:221
SG::ArenaBlockAllocatorBase::operator=
ArenaBlockAllocatorBase & operator=(const ArenaBlockAllocatorBase &)=delete
SG::ArenaAllocatorBase::Stats::Stat::total
size_t total
Total number of items held by the allocator.
Definition: ArenaAllocatorBase.h:207
SG::ArenaPoolAllocator::erase
virtual void erase() override final
Free all allocated elements and release memory back to the system.
Definition: ArenaPoolAllocator.cxx:191
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
VKalVrtAthena::varHolder_detail::clear
void clear(T &var)
Definition: NtupleVars.h:48
SG::ArenaBlockAllocatorBase::m_stats
ArenaAllocatorBase::Stats m_stats
The statistics structure.
Definition: ArenaBlockAllocatorBase.h:159
SG::ArenaBlock::protectList
static void protectList(ArenaBlock *p)
Write-protect all blocks in a list.
Definition: ArenaBlock.cxx:203
SG::ArenaBlockAllocatorBase::swap
void swap(ArenaBlockAllocatorBase &other)
Swap.
Definition: ArenaBlockAllocatorBase.cxx:91
SG::ArenaBlockAllocatorBase::m_freeblocks
ArenaBlock * m_freeblocks
The list of free blocks.
Definition: ArenaBlockAllocatorBase.h:156
SG::ArenaAllocatorBase::Params::eltSize
size_t eltSize
The size in bytes of the individual elements we're allocating.
Definition: ArenaAllocatorBase.h:155
SG::ArenaAllocatorBase::pointer
char * pointer
Type for pointers to elements.
Definition: ArenaAllocatorBase.h:137
SG::ArenaAllocatorBase::Params::destructor
func_t * destructor
Destructor function for elements.
Definition: ArenaAllocatorBase.h:172
SG::ArenaAllocatorBase::Stats::elts
Stat elts
Counts of elements.
Definition: ArenaAllocatorBase.h:219
SG::ArenaAllocatorBase::name
virtual const std::string & name() const =0
Return the name of this allocator.