ATLAS Offline Software
ArenaSharedHeapSTLAllocator.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
14 
15 
16 namespace SG {
17 
18 
27  int nblock)
28  : m_owner (owner),
29  m_nblock (nblock)
30 {
31 }
32 
33 
40 {
41  size_t sz = m_allocators.size();
42  for (size_t i = 0; i < sz; i++) {
43  delete m_allocators[i];
44  }
45 }
46 
47 
52 {
54  size_t sz = m_allocators.size();
55  for (size_t i = 0; i < sz; i++) {
56  if (m_allocators[i])
57  stats += m_allocators[i]->stats();
58  }
59  return stats;
60 }
61 
62 
67 void ArenaSharedHeapSTLHeader::report (std::ostream& os) const
68 {
69  for (size_t i = 0; i < m_allocators.size(); i++) {
70  if (m_allocators[i])
71  m_allocators[i]->report (os);
72  }
73 }
74 
75 
83 {
85  if (a) {
86  a->protect();
87  }
88  }
89 }
90 
91 
99 {
101  if (a) {
102  a->unprotect();
103  }
104  }
105 }
106 
107 
108 } // namespace SG
SG::ArenaSharedHeapSTLHeader::~ArenaSharedHeapSTLHeader
~ArenaSharedHeapSTLHeader()
Destructor.
Definition: ArenaSharedHeapSTLAllocator.cxx:39
fitman.sz
sz
Definition: fitman.py:527
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
SG::ArenaSharedHeapSTLHeader::protect
void protect()
Write-protect the memory managed by these allocators.
Definition: ArenaSharedHeapSTLAllocator.cxx:82
SG::ArenaHeapAllocator
Heap-based allocator.
Definition: ArenaHeapAllocator.h:64
trigbs_dumpHLTContentInBS.stats
stats
Definition: trigbs_dumpHLTContentInBS.py:91
SG::ArenaAllocatorBase::Stats
Statistics for an allocator.
Definition: ArenaAllocatorBase.h:188
lumiFormat.i
int i
Definition: lumiFormat.py:92
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
ArenaSharedHeapSTLAllocator.h
STL-style allocator wrapper for ArenaHeapAllocator allowing the heap to be shared between containers.
SG::ArenaSharedHeapSTLHeader::m_allocators
std::vector< ArenaHeapAllocator * > m_allocators
List of allocators.
Definition: ArenaSharedHeapSTLAllocator.h:189
a
TList * a
Definition: liststreamerinfos.cxx:10
SG::ArenaSharedHeapSTLHeader::ArenaSharedHeapSTLHeader
ArenaSharedHeapSTLHeader(const void *owner, int nblock)
Constructor.
Definition: ArenaSharedHeapSTLAllocator.cxx:26
SG::ArenaSharedHeapSTLHeader::unprotect
void unprotect()
Write-enable the memory managed by these allocators.
Definition: ArenaSharedHeapSTLAllocator.cxx:98
SG::ArenaSharedHeapSTLHeader::report
void report(std::ostream &os) const
Generate printable report for all contained allocators.
Definition: ArenaSharedHeapSTLAllocator.cxx:67
SG::ArenaSharedHeapSTLHeader::totstats
ArenaAllocatorBase::Stats totstats() const
Return allocator statistics summed over all our owned allocators.
Definition: ArenaSharedHeapSTLAllocator.cxx:51