Ejemplo n.º 1
0
    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
Ejemplo n.º 2
0
//-----------------------------------------------------------------------------
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());
}