26 void allocCalled(
size_t iRequested,
size_t iActual,
void const*)
final {
27 nAllocations_.fetch_add(1, std::memory_order_acq_rel);
28 requested_.fetch_add(iRequested, std::memory_order_acq_rel);
31 auto a = presentActual_.fetch_add(iActual, std::memory_order_acq_rel);
33 auto max = maxActual_.load(std::memory_order_relaxed);
35 if (maxActual_.compare_exchange_strong(
max,
a, std::memory_order_acq_rel)) {
41 nDeallocations_.fetch_add(1, std::memory_order_acq_rel);
42 auto present = presentActual_.load(std::memory_order_acquire);
43 if (present >= iActual) {
44 presentActual_.fetch_sub(iActual, std::memory_order_acq_rel);
48 void performanceReport()
const {
49 auto finalRequested = requested_.load(std::memory_order_acquire);
50 auto maxActual = maxActual_.load(std::memory_order_acquire);
51 auto allocs = nAllocations_.load(std::memory_order_acquire);
52 auto deallocs = nDeallocations_.load(std::memory_order_acquire);
56 <<
"\n [monitoring spans the lifetime of Services (first plugins made and last to be deleted)]" 57 <<
"\n total additional memory requested: " << finalRequested
58 <<
"\n max additional memory used: " << maxActual <<
"\n # allocations calls: " << allocs
59 <<
"\n # deallocations calls: " << deallocs;
63 std::atomic<size_t> requested_ = 0;
64 std::atomic<size_t> presentActual_ = 0;
65 std::atomic<size_t> maxActual_ = 0;
66 std::atomic<size_t> nAllocations_ = 0;
67 std::atomic<size_t> nDeallocations_ = 0;
Log< level::System, false > LogSystem
#define DEFINE_FWK_SERVICE_MAKER(concrete, maker)
static PFTauRenderPlugin instance
Namespace of DDCMS conversion namespace.
MonitorAdaptor * adaptor_