26 void allocCalled(
size_t iRequested,
size_t iActual,
void const*)
final {
27 auto&
a = allocRequested_[
bin(iRequested)];
28 a.fetch_add(1, std::memory_order_acq_rel);
30 auto& u = allocUsed_[
bin(iActual)];
31 u.fetch_add(1, std::memory_order_acq_rel);
34 auto& u = deallocUsed_[
bin(iActual)];
35 u.fetch_add(1, std::memory_order_acq_rel);
38 void performanceReport()
const {
40 log <<
"Memory Histogram" 41 <<
"\n size | allocated | deallocated" 42 <<
"\n | requested used | used";
44 for (
unsigned int i = 0;
i < allocRequested_.size(); ++
i) {
46 << std::setw(12) <<
size <<
" " << std::setw(12) << allocRequested_[
i] <<
" " << std::setw(12)
47 << allocUsed_[
i] <<
" " << std::setw(12) << deallocUsed_[
i];
57 static size_t bin(
size_t iValue) {
67 std::array<std::atomic<size_t>, 40> allocRequested_;
68 std::array<std::atomic<size_t>, 40> allocUsed_;
69 std::array<std::atomic<size_t>, 40> deallocUsed_;
Log< level::System, false > LogSystem
#define DEFINE_FWK_SERVICE_MAKER(concrete, maker)
static PFTauRenderPlugin instance
~HistogrammingAllocMonitor()
MonitorAdaptor * adaptor_
Namespace of DDCMS conversion namespace.
HistogrammingAllocMonitor()