ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
AthAllocators
AthAllocators
ArenaBlockAllocatorBase.h
Go to the documentation of this file.
1
// This file's extension implies that it's C, but it's really -*- C++ -*-.
2
/*
3
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
4
*/
11
12
13
#ifndef ATHALLOCATORS_ARENABLOCKALLOCATORBASE_H
14
#define ATHALLOCATORS_ARENABLOCKALLOCATORBASE_H
15
16
17
#include "
AthAllocators/ArenaAllocatorBase.h
"
18
19
20
namespace
SG
{
21
22
23
class
ArenaBlock
;
24
25
33
class
ArenaBlockAllocatorBase
34
:
public
ArenaAllocatorBase
35
{
36
public
:
42
ArenaBlockAllocatorBase
(
const
Params
&
params
);
43
44
48
virtual
~ArenaBlockAllocatorBase
();
49
50
52
ArenaBlockAllocatorBase
(
const
ArenaBlockAllocatorBase
&) =
delete
;
53
ArenaBlockAllocatorBase
&
operator=
(
const
ArenaBlockAllocatorBase
&) =
delete
;
54
55
59
ArenaBlockAllocatorBase
(
ArenaBlockAllocatorBase
&& other);
60
61
65
ArenaBlockAllocatorBase
&
operator=
(
ArenaBlockAllocatorBase
&& other);
66
67
71
void
swap
(
ArenaBlockAllocatorBase
& other);
72
73
74
92
virtual
void
reserve
(
size_t
size
)
override
;
93
94
103
virtual
void
erase
()
override
;
104
105
109
virtual
Stats
stats
()
const override
;
110
111
115
virtual
const
std::string&
name
()
const override
;
116
117
121
const
Params
&
params
()
const
;
122
123
130
void
protect
();
131
132
139
void
unprotect
();
140
141
142
protected
:
147
ArenaBlock
*
getBlock
();
148
149
155
void
eraseUnprotected
();
156
158
Params
m_params
;
159
161
ArenaBlock
*
m_blocks
;
162
164
ArenaBlock
*
m_freeblocks
;
165
167
ArenaAllocatorBase::Stats
m_stats
;
168
170
bool
m_protected
;
171
};
172
173
174
}
// namespace SG
175
176
177
#endif
// not ATHALLOCATORS_ARENABLOCKALLOCATORBASE_H
ArenaAllocatorBase.h
Common base class for arena allocator classes. See Arena.h for an overview of the arena-based memory ...
SG::ArenaAllocatorBase
Common base class for arena allocator classes.
Definition
ArenaAllocatorBase.h:134
SG::ArenaBlockAllocatorBase::reserve
virtual void reserve(size_t size) override
Set the total number of elements cached by the allocator.
Definition
ArenaBlockAllocatorBase.cxx:120
SG::ArenaBlockAllocatorBase::unprotect
void unprotect()
Write-enable the memory managed by this allocator.
Definition
ArenaBlockAllocatorBase.cxx:294
SG::ArenaBlockAllocatorBase::ArenaBlockAllocatorBase
ArenaBlockAllocatorBase(const ArenaBlockAllocatorBase &)=delete
Don't allow copy construction or assignment.
SG::ArenaBlockAllocatorBase::params
const Params & params() const
Return this Allocator's parameters.
Definition
ArenaBlockAllocatorBase.cxx:235
SG::ArenaBlockAllocatorBase::getBlock
ArenaBlock * getBlock()
Return an empty block, either newly-allocated or from the free list.
Definition
ArenaBlockAllocatorBase.cxx:245
SG::ArenaBlockAllocatorBase::operator=
ArenaBlockAllocatorBase & operator=(const ArenaBlockAllocatorBase &)=delete
SG::ArenaBlockAllocatorBase::erase
virtual void erase() override
Free all allocated elements and release memory back to the system.
Definition
ArenaBlockAllocatorBase.cxx:172
SG::ArenaBlockAllocatorBase::~ArenaBlockAllocatorBase
virtual ~ArenaBlockAllocatorBase()
Destructor.
Definition
ArenaBlockAllocatorBase.cxx:38
SG::ArenaBlockAllocatorBase::eraseUnprotected
void eraseUnprotected()
Free all allocated elements and release memory back to the system.
Definition
ArenaBlockAllocatorBase.cxx:186
SG::ArenaBlockAllocatorBase::m_stats
ArenaAllocatorBase::Stats m_stats
The statistics structure.
Definition
ArenaBlockAllocatorBase.h:167
SG::ArenaBlockAllocatorBase::swap
void swap(ArenaBlockAllocatorBase &other)
Swap.
Definition
ArenaBlockAllocatorBase.cxx:91
SG::ArenaBlockAllocatorBase::ArenaBlockAllocatorBase
ArenaBlockAllocatorBase(const Params ¶ms)
Constructor.
Definition
ArenaBlockAllocatorBase.cxx:25
SG::ArenaBlockAllocatorBase::protect
void protect()
Write-protect the memory managed by this allocator.
Definition
ArenaBlockAllocatorBase.cxx:281
SG::ArenaBlockAllocatorBase::m_blocks
ArenaBlock * m_blocks
The list of blocks currently in use.
Definition
ArenaBlockAllocatorBase.h:161
SG::ArenaBlockAllocatorBase::stats
virtual Stats stats() const override
Return the statistics block for this allocator.
Definition
ArenaBlockAllocatorBase.cxx:207
SG::ArenaBlockAllocatorBase::m_params
Params m_params
The parameters for this allocator.
Definition
ArenaBlockAllocatorBase.h:158
SG::ArenaBlockAllocatorBase::name
virtual const std::string & name() const override
Return the name of this allocator.
Definition
ArenaBlockAllocatorBase.cxx:225
SG::ArenaBlockAllocatorBase::m_freeblocks
ArenaBlock * m_freeblocks
The list of free blocks.
Definition
ArenaBlockAllocatorBase.h:164
SG::ArenaBlockAllocatorBase::m_protected
bool m_protected
Flag whether the arena has been protected.
Definition
ArenaBlockAllocatorBase.h:170
SG::ArenaBlock
A large memory block that gets carved into smaller uniform elements.
Definition
ArenaBlock.h:43
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.
SG::ArenaAllocatorBase::Params
Allocator parameters.
Definition
ArenaAllocatorBase.h:150
SG::ArenaAllocatorBase::Stats
Statistics for an allocator.
Definition
ArenaAllocatorBase.h:188
Generated on
for ATLAS Offline Software by
1.17.0