Esempio n. 1
0
uint64_t
get_allocs()
{
#ifdef USE_JEMALLOC
    MemoryManager *mm = MemoryManager::TheMemoryManager();
    return mm->getAllocated();
#endif
#ifdef USE_TCMALLOC
    if (MallocExtensionInstance) {
        size_t stat;
        MallocExtensionInstance()->GetNumericProperty(
            "generic.thread_bytes_allocated", &stat);
        return stat;
    }
#endif
    return 0;
}