Skip to content
DebugAllocatorLiveCount

DebugAllocatorLiveCount

Description

Number of allocations currently outstanding (alloc minus free).

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);
        ok = ok && DebugAllocatorLiveCount(dbg) == 1;
        ok = ok && DebugAllocatorLiveBytes(dbg) == 128;
    
        AllocatorFree(adbg, p2, 128);
        ok = ok && DebugAllocatorLiveCount(dbg) == 0;
        ok = ok && DebugAllocatorLiveBytes(dbg) == 0;
        ok = ok && DebugAllocatorDoubleFrees(dbg) == 0;
        (void)AllocatorAlloc(adbg, 48, true);
    
        bool ok = DebugAllocatorLiveCount(dbg) == 2;
        ok      = ok && DebugAllocatorLiveBytes(dbg) == (32 + 48);
    // ---------------------------------------------------------------------------
    
    size DebugAllocatorLiveCount(const DebugAllocator *self) {
        if (!self)
            return 0;
Last updated on