Skip to content
DebugAllocatorLiveBytes

DebugAllocatorLiveBytes

Description

Total user-requested bytes currently outstanding.

Usage example (Cross-references)

Usage examples (Cross-references)
        bool ok = p1 && p2;
        ok      = ok && DebugAllocatorLiveCount(dbg) == 2;
        ok      = ok && DebugAllocatorLiveBytes(dbg) == (64 + 128);
    
        AllocatorFree(adbg, p1, 64);
        AllocatorFree(adbg, p1, 64);
        ok = ok && DebugAllocatorLiveCount(dbg) == 1;
        ok = ok && DebugAllocatorLiveBytes(dbg) == 128;
    
        AllocatorFree(adbg, p2, 128);
        AllocatorFree(adbg, p2, 128);
        ok = ok && DebugAllocatorLiveCount(dbg) == 0;
        ok = ok && DebugAllocatorLiveBytes(dbg) == 0;
        ok = ok && DebugAllocatorDoubleFrees(dbg) == 0;
        ok = ok && DebugAllocatorOverflows(dbg) == 0;
    
        bool ok = DebugAllocatorLiveCount(dbg) == 2;
        ok      = ok && DebugAllocatorLiveBytes(dbg) == (32 + 48);
    
        // DebugAllocatorDestroy will free the underlying buffers via the
    }
    
    size DebugAllocatorLiveBytes(const DebugAllocator *self) {
        if (!self)
            return 0;
Last updated on