64 os << std::setw(7) << stat.inuse <<
"/"
65 << std::setw(7) << stat.free <<
"/"
66 << std::setw(7) << stat.total;
118 os <<
"Elts InUse/Free/Total"
119 <<
" Bytes InUse/Free/Total Blocks InUse/Free/Total";
132 os <<
" " <<
stats() <<
" " <<
name() << std::endl;
Common base class for arena allocator classes. See Arena.h for an overview of the arena-based memory ...
virtual const std::string & name() const =0
Return the name of this allocator.
virtual void report(std::ostream &os) const
Generate a report on the memory usage of this allocator.
virtual Stats stats() const =0
Return the statistics block for this allocator.
std::ostream & operator<<(std::ostream &os, const ArenaAllocatorBase::Stats::Stat &stat)
Format a statistic structure.
Stat & operator+=(const Stat &other)
Accumulate.
void clear()
Reset to zero.
size_t free
Number of items currently not allocated by the application but cached by the allocator.
Stat()
Default constructor.
size_t inuse
Number of items currently allocated by the application.
size_t total
Total number of items held by the allocator.
Statistics for an allocator.
Stat blocks
Counts of blocks.
void clear()
Reset to zero.
Stat elts
Counts of elements.
static void header(std::ostream &os)
Print report header.
Stats & operator+=(const Stats &other)
Accumulate.
Stat bytes
Counts of bytes.