![]() |
ATLAS Offline Software
|
Collection of memory allocators with a common lifetime,. More...
#include <Arena.h>
Classes | |
| class | Push |
Helper class for making Arena instances current in a stack-like manner. More... | |
Public Member Functions | |
| Arena (const std::string &name, ArenaHeader *header=0) | |
| Constructor. More... | |
| ~Arena () | |
| Destructor. More... | |
| ArenaHeader * | header () |
Return the ArenaHeader with which this Arena is associated. More... | |
| ArenaBase * | makeCurrent () |
Make this Arena the current one for its ArenaHeader. More... | |
| LockedAllocator | allocator (size_t i) |
| Translate an integer index to an Allocator pointer. More... | |
| void | reset () |
| Reset all contained allocators. More... | |
| void | erase () |
| Erase all contained allocators. More... | |
| void | report (std::ostream &os) const |
Generate a report of the memory in use by this Arena. More... | |
| ArenaAllocatorBase::Stats | stats () const |
Return statistics summed over all allocators in this Arena. More... | |
| const std::string & | name () const |
Return this Arena's name. More... | |
Private Types | |
| typedef std::lock_guard< std::mutex > | lock_t |
Private Member Functions | |
| ArenaAllocatorBase * | makeAllocator (size_t i) |
| Make a new Allocator for index i. More... | |
Private Attributes | |
| ArenaHeader * | m_header |
The ArenaHeader with which we're associated. More... | |
| std::vector< AllocEntry > | m_allocs |
| std::string | m_name |
| Our name. More... | |
| std::mutex | m_mutex |
| To guard access to m_allocs. More... | |
Collection of memory allocators with a common lifetime,.
See the file-level comments for a full description.
|
privateinherited |
Definition at line 102 of file ArenaBase.h.
| SG::Arena::Arena | ( | const std::string & | name, |
| ArenaHeader * | header = 0 |
||
| ) |
Constructor.
| name | The name of this Arena; to use in reports. |
| header | The header with which this Arena is associated. If defaulted, the global default ArenaHeader will be used. |
| SG::Arena::~Arena | ( | ) |
|
inherited |
Translate an integer index to an Allocator pointer.
| i | The index to look up. |
If the index isn't valid, an assertion will be tripped.
|
inherited |
Erase all contained allocators.
All elements will be freed, and the memory returned to the system.
Definition at line 60 of file ArenaBase.cxx.
| ArenaHeader * SG::Arena::header | ( | ) |
Return the ArenaHeader with which this Arena is associated.
|
privateinherited |
Make a new Allocator for index i.
| i | The index of the Allocator. |
The Allocator vector was empty for index i. Make an appropriate new Allocator, store it in the vector, and return it. Will trip an assertion if the index is not valid.
This should be called with m_mutex held.
Definition at line 130 of file ArenaBase.cxx.
| ArenaBase * SG::Arena::makeCurrent | ( | ) |
|
inherited |
Return this Arena's name.
Definition at line 114 of file ArenaBase.cxx.
|
inherited |
Generate a report of the memory in use by this Arena.
| os | The stream to which to write the report. |
Definition at line 76 of file ArenaBase.cxx.
|
inherited |
|
inherited |
Return statistics summed over all allocators in this Arena.
Definition at line 97 of file ArenaBase.cxx.
|
privateinherited |
Definition at line 124 of file ArenaBase.h.
|
private |
The ArenaHeader with which we're associated.
|
mutableprivateinherited |
To guard access to m_allocs.
Definition at line 130 of file ArenaBase.h.
|
privateinherited |
Our name.
Definition at line 127 of file ArenaBase.h.
1.8.18