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::ArenaHeapAllocator Class Reference

Heap-based allocator. More...

#include <ArenaHeapAllocator.h>

Inheritance diagram for SG::ArenaHeapAllocator:
Collaboration diagram for SG::ArenaHeapAllocator:

Classes

struct  initParams
 Helper to initialize a parameters structure. More...
 

Public Types

typedef void iterator
 
typedef void const_iterator
 
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

 ArenaHeapAllocator (const Params &params)
 Constructor. More...
 
virtual ~ArenaHeapAllocator ()
 Destructor. More...
 
 ArenaHeapAllocator (const ArenaHeapAllocator &)=delete
 Don't allow copy construction or assignment. More...
 
ArenaHeapAllocatoroperator= (const ArenaHeapAllocator &)=delete
 
 ArenaHeapAllocator (ArenaHeapAllocator &&other)
 Move constructor. More...
 
ArenaHeapAllocatoroperator= (ArenaHeapAllocator &&other)
 Move assignment. More...
 
void swap (ArenaHeapAllocator &other)
 Swap. More...
 
pointer allocate ()
 Allocate a new element. More...
 
void free (pointer p)
 Free an 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 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...
 
void eraseUnprotected ()
 Free all allocated elements and release memory back to the system. 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 slowClear ()
 Call clear() for all allocated elements. More...
 
pointer refill ()
 Add more free elements to the pool, and allocate a new element. More...
 
pointerlink (pointer p) const
 Return a reference to the link for an element. 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_freeptr
 Pointer to the next free element. More...
 

Detailed Description

Heap-based allocator.

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

This is a block-based memory allocator, with heap-like behavior. This allows freeing individual elements, but we don't implement resetTo or an iterator.

There are some extra costs though.

Definition at line 62 of file ArenaHeapAllocator.h.

Member Typedef Documentation

◆ const_iterator

Definition at line 190 of file ArenaHeapAllocator.h.

◆ 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.

◆ iterator

Definition at line 189 of file ArenaHeapAllocator.h.

◆ pointer

typedef char* SG::ArenaAllocatorBase::pointer
inherited

Type for pointers to elements.

Definition at line 137 of file ArenaAllocatorBase.h.

Constructor & Destructor Documentation

◆ ArenaHeapAllocator() [1/3]

SG::ArenaHeapAllocator::ArenaHeapAllocator ( const Params params)

Constructor.

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

Definition at line 28 of file ArenaHeapAllocator.cxx.

30  m_freeptr (nullptr)
31 {
32  // Consistency check.
33  assert (params.linkOffset + sizeof (pointer) <= params.eltSize);
34 }

◆ ~ArenaHeapAllocator()

SG::ArenaHeapAllocator::~ArenaHeapAllocator ( )
virtual

Destructor.

This will free all the Allocator's storage.

Definition at line 40 of file ArenaHeapAllocator.cxx.

41 {
42  if (m_protected) {
43  try {
44  unprotect();
45  }
46  catch (const SG::ExcProtection&) {
47  // Got an error from mprotect...
48  std::abort();
49  }
50  }
52 }

◆ ArenaHeapAllocator() [2/3]

SG::ArenaHeapAllocator::ArenaHeapAllocator ( const ArenaHeapAllocator )
delete

Don't allow copy construction or assignment.

◆ ArenaHeapAllocator() [3/3]

SG::ArenaHeapAllocator::ArenaHeapAllocator ( ArenaHeapAllocator &&  other)

Move constructor.

Definition at line 58 of file ArenaHeapAllocator.cxx.

60  : ArenaBlockAllocatorBase (std::move (other)),
61  m_freeptr (other.m_freeptr)
62 {
63  // False positives
64  // cppcheck-suppress useInitializationList
65  other.m_freeptr = nullptr;
66 }

Member Function Documentation

◆ allocate()

pointer SG::ArenaHeapAllocator::allocate ( )

Allocate a new element.

The fast path of this will be completely inlined.

◆ 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.

◆ 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.

◆ erase()

void SG::ArenaHeapAllocator::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 139 of file ArenaHeapAllocator.cxx.

140 {
142  m_freeptr = nullptr;
143 }

◆ eraseUnprotected()

void SG::ArenaBlockAllocatorBase::eraseUnprotected ( )
protectedinherited

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

Assumes that the blocks are already unprotected.

Definition at line 186 of file ArenaBlockAllocatorBase.cxx.

187 {
188  // Do we need to run clear() on the allocated elements?
189  // If so, do so via reset().
190  if (m_params.mustClear && m_params.clear) {
191  reset();
192  }
193 
194  // Kill the block lists (both free and in use).
197  m_blocks = m_freeblocks = nullptr;
198 
199  // Reset statistics.
200  m_stats.clear();
201 }

◆ free()

void SG::ArenaHeapAllocator::free ( pointer  p)

Free an element.

Parameters
pThe element to be freed.

clear() will be called on the element at this point, if it has been defined.

◆ getBlock()

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

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

Update statistics appropriately.

Definition at line 245 of file ArenaBlockAllocatorBase.cxx.

246 {
247  if (m_protected) {
248  throw SG::ExcProtected();
249  }
250 
251  ArenaBlock* newblock = m_freeblocks;
252  if (newblock) {
253  // There's something on the free list. Remove it and update statistics.
254  m_freeblocks = newblock->link();
255  --m_stats.blocks.free;
256  }
257  else {
258  // Otherwise, we need to make a new block.
261  m_stats.elts.total += newblock->size();
262  ++m_stats.blocks.total;
263  }
264  // Finish updating statistics.
265  // (Remaining ones are computed in stats().)
266  ++m_stats.blocks.inuse;
267 
268  // Link it into the in-use list and return.
269  newblock->link() = m_blocks;
270  m_blocks = newblock;
271  return newblock;
272 }

◆ link()

pointer& SG::ArenaHeapAllocator::link ( pointer  p) const
private

Return a reference to the link for an element.

Parameters
pThe element.

◆ 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 225 of file ArenaBlockAllocatorBase.cxx.

226 {
227  return m_params.name;
228 }

◆ operator=() [1/2]

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

Move assignment.

Definition at line 73 of file ArenaHeapAllocator.cxx.

75 {
76  if (this != &other) {
78  m_freeptr = other.m_freeptr;
79  other.m_freeptr = nullptr;
80  }
81  return *this;
82 }

◆ operator=() [2/2]

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

◆ params()

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

Return this Allocator's parameters.

Return this allocator's parameters.

Definition at line 235 of file ArenaBlockAllocatorBase.cxx.

236 {
237  return m_params;
238 }

◆ 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 281 of file ArenaBlockAllocatorBase.cxx.

282 {
284  m_protected = true;
285 }

◆ refill()

ArenaHeapAllocator::pointer SG::ArenaHeapAllocator::refill ( )
private

Add more free elements to the pool, and allocate a new element.

Definition at line 149 of file ArenaHeapAllocator.cxx.

150 {
151  // Get a new block.
152  ArenaBlock* newblock = getBlock();
153 
154  // Set up the links for the new free elements.
155  pointer lastelt = nullptr;
156  size_t sz = newblock->size();
157  size_t elt_size = newblock->eltSize();
158  for (size_t i=1; i < sz; i++) {
159  pointer elt = newblock->index (i, elt_size);
160  link(elt) = lastelt;
161  lastelt = elt;
162  }
163  // Set the free pointer to the next-to-last one.
164  m_freeptr = newblock->index (sz-1, elt_size);
165 
166  // And return the last one.
167  return newblock->index (0, elt_size);
168 }

◆ 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 130 of file ArenaAllocatorBase.cxx.

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

◆ 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::ArenaHeapAllocator::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 105 of file ArenaHeapAllocator.cxx.

106 {
107  if (!m_blocks) return;
108  if (m_params.clear) {
109  if (m_params.canReclear || m_freeptr == nullptr) {
110  // Just call clear() on all blocks --- allocated or not.
112  }
113  else {
114  // We can only call clear() on allocated blocks.
115  slowClear();
116  }
117  }
118 
119  // Move all blocks back to the free list.
121 
122  // Reset state.
123  m_blocks = nullptr;
124  m_freeptr = nullptr;
125  m_stats.elts.inuse = 0;
127  m_stats.blocks.inuse = 0;
128 }

◆ slowClear()

void SG::ArenaHeapAllocator::slowClear ( )
private

Call clear() for all allocated elements.

Definition at line 174 of file ArenaHeapAllocator.cxx.

175 {
176  // Make a list of all free elements, in sorted order.
177  std::vector<pointer> free_ptrs;
178  free_ptrs.reserve (m_stats.elts.total - m_stats.elts.inuse);
179  for (pointer p = m_freeptr; p; p = link(p)) {
180  free_ptrs.push_back (p);
181  }
182  std::sort (free_ptrs.begin(), free_ptrs.end());
183 
184  // Make a list of all used blocks, in sorted order.
185  std::vector<ArenaBlock*> blocks;
186  for (ArenaBlock* p = m_blocks; p; p = p->link()) {
187  blocks.push_back (p);
188  }
189  std::sort (blocks.begin(), blocks.end());
190 
191  // Walk through both of these lists.
192  // For each block, walk through its elements, and call @c clear
193  // for those not on the free list.
194  std::vector<pointer>::iterator pi = free_ptrs.begin();
195  std::vector<pointer>::iterator pi_end = free_ptrs.end();
196  std::vector<ArenaBlock*>::iterator bi = blocks.begin();
197  std::vector<ArenaBlock*>::iterator bi_end = blocks.end();
199  for (; bi != bi_end; ++bi) {
200  ArenaBlock& bl = **bi;
201  size_t sz = bl.size();
202  size_t elt_size = bl.eltSize();
203  for (size_t i = 0; i < sz; i++) {
204  pointer ptr = bl.index (i, elt_size);
205  if (pi != pi_end && ptr == *pi) {
206  ++pi;
207  }
208  else {
209  clear (ptr);
210  }
211  }
212  }
213 }

◆ stats()

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

Return the statistics block for this allocator.

Implements SG::ArenaAllocatorBase.

Definition at line 207 of file ArenaBlockAllocatorBase.cxx.

208 {
209  // Calculate derived statistics.
210  Stats stats = m_stats;
218  return stats;
219 }

◆ 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::ArenaHeapAllocator::swap ( ArenaHeapAllocator other)

Swap.

Definition at line 88 of file ArenaHeapAllocator.cxx.

89 {
90  if (this != &other) {
92  std::swap (m_freeptr, other.m_freeptr);
93  }
94 }

◆ 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 294 of file ArenaBlockAllocatorBase.cxx.

295 {
296  if (m_protected) {
298  m_protected = false;
299  }
300 }

Member Data Documentation

◆ m_blocks

ArenaBlock* SG::ArenaBlockAllocatorBase::m_blocks
protectedinherited

The list of blocks currently in use.

Definition at line 161 of file ArenaBlockAllocatorBase.h.

◆ m_freeblocks

ArenaBlock* SG::ArenaBlockAllocatorBase::m_freeblocks
protectedinherited

The list of free blocks.

Definition at line 164 of file ArenaBlockAllocatorBase.h.

◆ m_freeptr

pointer SG::ArenaHeapAllocator::m_freeptr
private

Pointer to the next free element.

Definition at line 213 of file ArenaHeapAllocator.h.

◆ m_params

Params SG::ArenaBlockAllocatorBase::m_params
protectedinherited

The parameters for this allocator.

Definition at line 158 of file ArenaBlockAllocatorBase.h.

◆ m_protected

bool SG::ArenaBlockAllocatorBase::m_protected
protectedinherited

Flag whether the arena has been protected.

Definition at line 170 of file ArenaBlockAllocatorBase.h.

◆ m_stats

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

The statistics structure.

Definition at line 167 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:235
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
SG::ArenaBlockAllocatorBase::m_blocks
ArenaBlock * m_blocks
The list of blocks currently in use.
Definition: ArenaBlockAllocatorBase.h:161
SG::ArenaAllocatorBase::Params::constructor
func_t * constructor
Constructor function for elements.
Definition: ArenaAllocatorBase.h:170
SG::ExcProtection
Exception — Attempt to change memory protection failed.
Definition: Control/AthAllocators/AthAllocators/exceptions.h:43
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:245
SG::ArenaBlock::destroy
static void destroy(ArenaBlock *p, func_t *dtor)
Destroy a block.
Definition: ArenaBlock.cxx:71
SG::ArenaAllocatorBase::Params::nblock
size_t nblock
The number of elements we should allocate in a single block (hint only).
Definition: ArenaAllocatorBase.h:162
SG::ArenaAllocatorBase::Params::mustClear
bool mustClear
If true, the clear call cannot be skipped before destructor.
Definition: ArenaAllocatorBase.h:181
SG::ArenaBlock::applyList
static void applyList(ArenaBlock *p, func_t *func, size_t n)
Call a function on elements in a list of blocks.
Definition: ArenaBlock.cxx:133
SG::ArenaBlockAllocatorBase::m_params
Params m_params
The parameters for this allocator.
Definition: ArenaBlockAllocatorBase.h:158
SG::ArenaBlock::overhead
static size_t overhead()
Return the per-block memory overhead, in bytes.
Definition: ArenaBlock.cxx:159
SG::ArenaBlock::newBlock
static ArenaBlock * newBlock(size_t n, size_t elt_size, func_t *ctor)
Create a new block.
Definition: ArenaBlock.cxx:42
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
dbg::ptr
void * ptr(T *p)
Definition: SGImplSvc.cxx:74
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:170
SG::ArenaBlock::appendList
static void appendList(ArenaBlock **headp, ArenaBlock *tail)
Concatenate two lists of blocks.
Definition: ArenaBlock.cxx:112
SG::ArenaAllocatorBase::Stats::Stat::inuse
size_t inuse
Number of items currently allocated by the application.
Definition: ArenaAllocatorBase.h:202
pi
#define pi
Definition: TileMuonFitter.cxx:65
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:220
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
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:209
SG::ArenaAllocatorBase::Stats::clear
void clear()
Reset to zero.
Definition: ArenaAllocatorBase.cxx:77
SG::ArenaHeapAllocator::slowClear
void slowClear()
Call clear() for all allocated elements.
Definition: ArenaHeapAllocator.cxx:174
SG::ArenaBlockAllocatorBase::stats
virtual Stats stats() const override
Return the statistics block for this allocator.
Definition: ArenaBlockAllocatorBase.cxx:207
lumiFormat.i
int i
Definition: lumiFormat.py:85
SG::ArenaBlock::size
size_t size() const
Return the number of elements in the block.
WriteCalibToCool.swap
swap
Definition: WriteCalibToCool.py:94
SG::ArenaBlockAllocatorBase::eraseUnprotected
void eraseUnprotected()
Free all allocated elements and release memory back to the system.
Definition: ArenaBlockAllocatorBase.cxx:186
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::ArenaHeapAllocator::m_freeptr
pointer m_freeptr
Pointer to the next free element.
Definition: ArenaHeapAllocator.h:213
SG::ArenaAllocatorBase::Stats::Stat::total
size_t total
Total number of items held by the allocator.
Definition: ArenaAllocatorBase.h:207
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:167
SG::ArenaAllocatorBase::Params::linkOffset
size_t linkOffset
Offset from the start of a free element to a pointer to be used by the allocator.
Definition: ArenaAllocatorBase.h:166
SG::ArenaBlock::protectList
static void protectList(ArenaBlock *p)
Write-protect all blocks in a list.
Definition: ArenaBlock.cxx:205
std::sort
void sort(typename std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, typename std::reverse_iterator< DataModel_detail::iterator< DVL > > end, const Compare &comp)
Specialization of sort for DataVector/List.
Definition: DVL_algorithms.h:623
SG::ArenaBlock::destroyList
static void destroyList(ArenaBlock *p, func_t *dtor)
Destroy all blocks in a list.
Definition: ArenaBlock.cxx:93
SG::ArenaBlockAllocatorBase::unprotect
void unprotect()
Write-enable the memory managed by this allocator.
Definition: ArenaBlockAllocatorBase.cxx:294
SG::ArenaAllocatorBase::Params::canReclear
bool canReclear
If true, clear can be called more than once on a given element.
Definition: ArenaAllocatorBase.h:178
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:164
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::reset
virtual void reset()=0
Free all allocated elements.
SG::ArenaHeapAllocator::link
pointer & link(pointer p) const
Return a reference to the link for an element.
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.