ATLAS Offline Software
Loading...
Searching...
No Matches
Control
AthAllocators
src
ArenaSharedHeapSTLAllocator.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3
*/
11
12
13
#include "
AthAllocators/ArenaSharedHeapSTLAllocator.h
"
14
15
16
namespace
SG
{
17
18
26
ArenaSharedHeapSTLHeader::ArenaSharedHeapSTLHeader
(
const
void
* owner,
27
int
nblock)
28
:
m_owner
(owner),
29
m_nblock
(nblock)
30
{
31
}
32
33
39
ArenaSharedHeapSTLHeader::~ArenaSharedHeapSTLHeader
()
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
51
ArenaAllocatorBase::Stats
ArenaSharedHeapSTLHeader::totstats
()
const
52
{
53
ArenaAllocatorBase::Stats
stats;
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
82
void
ArenaSharedHeapSTLHeader::protect
()
83
{
84
for
(
ArenaHeapAllocator
*
a
:
m_allocators
) {
85
if
(
a
) {
86
a
->protect();
87
}
88
}
89
}
90
91
98
void
ArenaSharedHeapSTLHeader::unprotect
()
99
{
100
for
(
ArenaHeapAllocator
*
a
:
m_allocators
) {
101
if
(
a
) {
102
a
->unprotect();
103
}
104
}
105
}
106
107
108
}
// namespace SG
ArenaSharedHeapSTLAllocator.h
STL-style allocator wrapper for ArenaHeapAllocator allowing the heap to be shared between containers.
sz
static Double_t sz
Definition
LArPhysWaveHECTool.cxx:37
a
static Double_t a
Definition
LArPhysWaveHECTool.cxx:38
SG::ArenaHeapAllocator
Heap-based allocator.
Definition
ArenaHeapAllocator.h:64
SG::ArenaSharedHeapSTLHeader::m_owner
const void * m_owner
Address of the allocator that created this header.
Definition
ArenaSharedHeapSTLAllocator.h:182
SG::ArenaSharedHeapSTLHeader::totstats
ArenaAllocatorBase::Stats totstats() const
Return allocator statistics summed over all our owned allocators.
Definition
ArenaSharedHeapSTLAllocator.cxx:51
SG::ArenaSharedHeapSTLHeader::protect
void protect()
Write-protect the memory managed by these allocators.
Definition
ArenaSharedHeapSTLAllocator.cxx:82
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::m_nblock
size_t m_nblock
Saved value for nblock parameter.
Definition
ArenaSharedHeapSTLAllocator.h:185
SG::ArenaSharedHeapSTLHeader::ArenaSharedHeapSTLHeader
ArenaSharedHeapSTLHeader(const void *owner, int nblock)
Constructor.
Definition
ArenaSharedHeapSTLAllocator.cxx:26
SG::ArenaSharedHeapSTLHeader::~ArenaSharedHeapSTLHeader
~ArenaSharedHeapSTLHeader()
Destructor.
Definition
ArenaSharedHeapSTLAllocator.cxx:39
SG::ArenaSharedHeapSTLHeader::m_allocators
std::vector< ArenaHeapAllocator * > m_allocators
List of allocators.
Definition
ArenaSharedHeapSTLAllocator.h:188
SG
Forward declaration.
Definition
CaloCellPacker_400_500.h:32
SG::ArenaAllocatorBase::Stats
Statistics for an allocator.
Definition
ArenaAllocatorBase.h:188
Generated on
for ATLAS Offline Software by
1.14.0