ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
AthAllocators
AthAllocators
ArenaBase.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
/*
4
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
5
*/
6
7
// $Id: ArenaBase.h 470529 2011-11-24 23:54:22Z ssnyder $
8
18
19
#ifndef ATLALLOCATORS_ARENABASE_H
20
#define ATLALLOCATORS_ARENABASE_H
21
22
23
#include "
AthAllocators/ArenaAllocatorBase.h
"
24
#include "
AthAllocators/LockedAllocator.h
"
25
#include <iosfwd>
26
#include <string>
27
#include <vector>
28
#include <memory>
29
#include <mutex>
30
31
32
namespace
SG
{
33
34
41
class
ArenaBase
42
{
43
public
:
48
ArenaBase
(
const
std::string&
name
=
""
);
49
50
52
virtual
~ArenaBase
();
53
54
55
ArenaBase
(
const
ArenaBase
&) =
delete
;
56
ArenaBase
&
operator=
(
const
ArenaBase
&) =
delete
;
57
58
59
66
LockedAllocator
allocator
(
size_t
i);
67
68
72
void
reset
();
73
74
79
void
erase
();
80
81
86
void
report
(std::ostream& os)
const
;
87
88
92
ArenaAllocatorBase::Stats
stats
()
const
;
93
94
98
const
std::string&
name
()
const
;
99
100
101
private
:
102
typedef
std::lock_guard<std::mutex>
lock_t
;
103
104
115
ArenaAllocatorBase
*
makeAllocator
(
size_t
i);
116
117
119
struct
AllocEntry
120
{
121
std::unique_ptr<ArenaAllocatorBase>
m_alloc
;
122
std::unique_ptr<std::mutex>
m_mutex
;
123
};
124
std::vector<AllocEntry>
m_allocs
;
125
127
std::string
m_name
;
128
130
mutable
std::mutex
m_mutex
;
131
};
132
133
134
}
// namespace SG
135
136
137
#include "
AthAllocators/ArenaBase.icc
"
138
139
140
#endif
// not ATLALLOCATORS_ARENABASE_H
141
ArenaAllocatorBase.h
Common base class for arena allocator classes. See Arena.h for an overview of the arena-based memory ...
ArenaBase.icc
LockedAllocator.h
A pointer type that holds a lock on an allocator object.
SG::ArenaAllocatorBase
Common base class for arena allocator classes.
Definition
ArenaAllocatorBase.h:134
SG::ArenaBase::reset
void reset()
Reset all contained allocators.
Definition
ArenaBase.cxx:44
SG::ArenaBase::report
void report(std::ostream &os) const
Generate a report of the memory in use by this Arena.
Definition
ArenaBase.cxx:76
SG::ArenaBase::stats
ArenaAllocatorBase::Stats stats() const
Return statistics summed over all allocators in this Arena.
Definition
ArenaBase.cxx:97
SG::ArenaBase::ArenaBase
ArenaBase(const std::string &name="")
Constructor.
Definition
ArenaBase.cxx:27
SG::ArenaBase::~ArenaBase
virtual ~ArenaBase()
Destructor.
Definition
ArenaBase.cxx:36
SG::ArenaBase::lock_t
std::lock_guard< std::mutex > lock_t
Definition
ArenaBase.h:102
SG::ArenaBase::name
const std::string & name() const
Return this Arena's name.
Definition
ArenaBase.cxx:114
SG::ArenaBase::erase
void erase()
Erase all contained allocators.
Definition
ArenaBase.cxx:60
SG::ArenaBase::operator=
ArenaBase & operator=(const ArenaBase &)=delete
SG::ArenaBase::m_mutex
std::mutex m_mutex
To guard access to m_allocs.
Definition
ArenaBase.h:130
SG::ArenaBase::allocator
LockedAllocator allocator(size_t i)
Translate an integer index to an Allocator pointer.
SG::ArenaBase::m_name
std::string m_name
Our name.
Definition
ArenaBase.h:127
SG::ArenaBase::ArenaBase
ArenaBase(const ArenaBase &)=delete
SG::ArenaBase::makeAllocator
ArenaAllocatorBase * makeAllocator(size_t i)
Make a new Allocator for index i.
Definition
ArenaBase.cxx:130
SG::ArenaBase::m_allocs
std::vector< AllocEntry > m_allocs
Definition
ArenaBase.h:124
SG::LockedAllocator
A pointer type that holds a lock on an allocator object.
Definition
LockedAllocator.h:40
SG
Forward declaration.
Definition
CaloCellPacker_400_500.h:32
SG::ArenaAllocatorBase::Stats
Statistics for an allocator.
Definition
ArenaAllocatorBase.h:188
SG::ArenaBase::AllocEntry
Our allocator vector.
Definition
ArenaBase.h:120
SG::ArenaBase::AllocEntry::m_mutex
std::unique_ptr< std::mutex > m_mutex
Definition
ArenaBase.h:122
SG::ArenaBase::AllocEntry::m_alloc
std::unique_ptr< ArenaAllocatorBase > m_alloc
Definition
ArenaBase.h:121
Generated on
for ATLAS Offline Software by
1.17.0