ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
AthAllocators
src
ArenaHandleBase.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
// $Id: ArenaHandleBase.cxx 470529 2011-11-24 23:54:22Z ssnyder $
13
14
15
#include "
AthAllocators/ArenaHandleBase.h
"
16
#include "
AthAllocators/ArenaAllocatorBase.h
"
17
18
19
namespace
SG
{
20
21
28
ArenaHandleBase::ArenaHandleBase
(
ArenaHeader
*
header
,
size_t
index
)
29
:
m_allocator
( (
header
?
header
:
ArenaHeader
::defaultHeader()) ->
30
allocator (
index
))
31
{
32
}
33
34
42
ArenaHandleBase::ArenaHandleBase
(
ArenaHeader
*
header
,
43
const
EventContext& ctx,
44
size_t
index
)
45
:
m_allocator
( (
header
?
header
:
ArenaHeader
::defaultHeader()) ->
46
allocator (ctx,
index
))
47
{
48
}
49
50
56
ArenaHandleBase::ArenaHandleBase
(
ArenaBase
* arena,
size_t
index
)
57
:
m_allocator
(arena->allocator (
index
))
58
{
59
}
60
61
71
void
ArenaHandleBase::reset
()
72
{
73
return
baseAllocator
()->
reset
();
74
}
75
76
87
void
ArenaHandleBase::erase
()
88
{
89
return
baseAllocator
()->
erase
();
90
}
91
92
97
*
98
* This allows changing the number of elements that are currently free
99
* but cached. Any allocated elements are not affected by this call.
100
*
101
* If @c size is greater than the total number of elements currently
102
* cached, then more will be allocated. This will preferably done
103
* with a single block, but that is not guaranteed; in addition, the
104
* allocator may allocate more elements than is requested.
105
*
106
* If @c size is smaller than the total number of elements currently
107
* cached, as many blocks as possible will be released back to the system.
108
* It may not be possible to release the number of elements requested;
109
* this should be implemented on a best-effort basis.
110
*/
111
void
ArenaHandleBase::reserve
(
size_t
size
)
112
{
113
return
baseAllocator
()->
reserve
(
size
);
114
}
115
116
121
ArenaAllocatorBase::Stats
ArenaHandleBase::stats
()
const
122
{
123
return
baseAllocator
()->
stats
();
124
}
125
126
127
}
// namespace SG
ArenaAllocatorBase.h
Common base class for arena allocator classes. See Arena.h for an overview of the arena-based memory ...
ArenaHandleBase.h
Base class for all Handle classes, containing parts that do not depend on the referenced type....
SG::ArenaAllocatorBase::reset
virtual void reset()=0
Free all allocated elements.
SG::ArenaAllocatorBase::reserve
virtual void reserve(size_t size)=0
Set the total number of elements cached by the allocator.
SG::ArenaAllocatorBase::erase
virtual void erase()=0
Free all allocated elements and release memory back to the system.
SG::ArenaAllocatorBase::stats
virtual Stats stats() const =0
Return the statistics block for this allocator.
SG::ArenaBase
Part of Arena dealing with the list of allocators.
Definition
ArenaBase.h:42
SG::ArenaHandleBase::ArenaHandleBase
ArenaHandleBase(ArenaHeader *header, size_t index)
Constructor.
Definition
ArenaHandleBase.cxx:28
SG::ArenaHandleBase::baseAllocator
ArenaAllocatorBase * baseAllocator()
Return the current Allocator which we are referencing.
SG::ArenaHandleBase::reset
void reset()
Free all allocated elements (of this type in the current Arena).
Definition
ArenaHandleBase.cxx:71
SG::ArenaHandleBase::reserve
void reserve(size_t size)
Set the total number of elements cached by the allocator (in the current Arena).
Definition
ArenaHandleBase.cxx:111
SG::ArenaHandleBase::erase
void erase()
Free all allocated elements and release memory back to the system (of this type in the current Arena)...
Definition
ArenaHandleBase.cxx:87
SG::ArenaHandleBase::stats
ArenaAllocatorBase::Stats stats() const
Return the statistics block for this allocator, for the current Arena.
Definition
ArenaHandleBase.cxx:121
SG::ArenaHandleBase::m_allocator
LockedAllocator m_allocator
The associated allocator object.
Definition
ArenaHandleBase.h:160
SG::ArenaHeader
Proxy for a group of Arenas.
Definition
ArenaHeader.h:54
header
Definition
hcg.cxx:529
SG
Forward declaration.
Definition
CaloCellPacker_400_500.h:32
SG::size
virtual size_t size() const override
Return the number of elements in the store.
index
Definition
index.py:1
SG::ArenaAllocatorBase::Stats
Statistics for an allocator.
Definition
ArenaAllocatorBase.h:188
Generated on
for ATLAS Offline Software by
1.17.0