![]() |
ATLAS Offline Software
|
Part of Arena dealing with the list of allocators.
More...
#include <ArenaBase.h>
Classes | |
| struct | AllocEntry |
| Our allocator vector. More... | |
Public Member Functions | |
| ArenaBase (const std::string &name="") | |
| Constructor. More... | |
| virtual | ~ArenaBase () |
| Destructor. More... | |
| ArenaBase (const ArenaBase &)=delete | |
| ArenaBase & | operator= (const ArenaBase &)=delete |
| 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 | |
| std::vector< AllocEntry > | m_allocs |
| std::string | m_name |
| Our name. More... | |
| std::mutex | m_mutex |
| To guard access to m_allocs. More... | |
Part of Arena dealing with the list of allocators.
Broken out from Arena to avoid a dependency loop with ArenaHeader. See Arena.h for an overview of the arena-based memory allocators.
Definition at line 41 of file ArenaBase.h.
|
private |
Definition at line 102 of file ArenaBase.h.
| SG::ArenaBase::ArenaBase | ( | const std::string & | name = "" | ) |
Constructor.
| name | The name of this Arena; to use in reports. |
Definition at line 27 of file ArenaBase.cxx.
|
virtual |
| LockedAllocator SG::ArenaBase::allocator | ( | size_t | i | ) |
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.
| void SG::ArenaBase::erase | ( | ) |
Erase all contained allocators.
All elements will be freed, and the memory returned to the system.
Definition at line 60 of file ArenaBase.cxx.
|
private |
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.
| const std::string & SG::ArenaBase::name | ( | ) | const |
Return this Arena's name.
Definition at line 114 of file ArenaBase.cxx.
| void SG::ArenaBase::report | ( | std::ostream & | os | ) | const |
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.
| void SG::ArenaBase::reset | ( | ) |
| ArenaAllocatorBase::Stats SG::ArenaBase::stats | ( | ) | const |
Return statistics summed over all allocators in this Arena.
Definition at line 97 of file ArenaBase.cxx.
|
private |
Definition at line 124 of file ArenaBase.h.
|
mutableprivate |
To guard access to m_allocs.
Definition at line 130 of file ArenaBase.h.
|
private |
Our name.
Definition at line 127 of file ArenaBase.h.
1.8.18