size_t allocated_bytes() { size_t allocated_size(0); #ifdef HAS_TCMALLOC MallocExtension::instance()-> GetNumericProperty("generic.current_allocated_bytes", &allocated_size); #else logstream_once(LOG_WARNING) << "memory_info::allocated_bytes() requires tcmalloc" << std::endl; #endif return allocated_size; } // end of allocated bytes
//----------------------------------------------------------------------------- StackAllocator::~StackAllocator() { CE_ASSERT(m_allocation_count == 0 && allocated_size() == 0, "Missing %d deallocations causing a leak of %d bytes", m_allocation_count, allocated_size()); }