49 lock_t alloc_lock (*alloc.m_mutex);
50 alloc.m_alloc->reset();
65 lock_t alloc_lock (*alloc.m_mutex);
66 alloc.m_alloc->erase();
87 lock_t alloc_lock (*alloc.m_mutex);
88 alloc.m_alloc->report (os);
103 lock_t alloc_lock (*alloc.m_mutex);
104 stats += alloc.m_alloc->stats();
139 std::unique_ptr<ArenaAllocatorBase> alloc =
143 m_allocs[i].m_alloc = std::move (alloc);
144 m_allocs[i].m_mutex = std::make_unique<std::mutex>();
Common base class for arena allocator classes. See Arena.h for an overview of the arena-based memory ...
Registry of allocator factories. See Arena.h for an overview of the arena-based memory allocators.
Part of Arena dealing with the list of allocators. Broken out from Arena to avoid a dependency loop w...
Common base class for arena allocator classes.
std::unique_ptr< ArenaAllocatorBase > create(size_t i)
Create a new instance of an allocator.
static ArenaAllocatorRegistry * instance()
Return a pointer to the global ArenaAllocatorRegistry instance.
void reset()
Reset all contained allocators.
void report(std::ostream &os) const
Generate a report of the memory in use by this Arena.
ArenaAllocatorBase::Stats stats() const
Return statistics summed over all allocators in this Arena.
ArenaBase(const std::string &name="")
Constructor.
virtual ~ArenaBase()
Destructor.
std::lock_guard< std::mutex > lock_t
const std::string & name() const
Return this Arena's name.
void erase()
Erase all contained allocators.
std::mutex m_mutex
To guard access to m_allocs.
std::string m_name
Our name.
ArenaAllocatorBase * makeAllocator(size_t i)
Make a new Allocator for index i.
std::vector< AllocEntry > m_allocs
Statistics for an allocator.
static void header(std::ostream &os)
Print report header.