TMemoryAllocCount Record

type TMemoryAllocCount = record

The calling thread's heap calls since its last MarkMemoryAllocCount, by kind, as MemoryAllocCount returns them.

The counting manager counts only while it is installed (InstallMemoryAllocCount).

Examples

A Char converted to a string takes one block from the memory manager.

delphi
uses Substr;

procedure Example;
var c: Char;
    t: string;
    k: TMemoryAllocCount;
begin
    c := 'x';
    InstallMemoryAllocCount;
    try
        MarkMemoryAllocCount;
        t := c;
        k := MemoryAllocCount;
        Assert((k.GetMems = 1) and (k.ReallocMems = 0) and (k.FreeMems = 0));
    finally
        RemoveMemoryAllocCount;
    end;
    Assert(t = 'x');
end;

Fields

NameTypeDescription
FreeMemsNativeIntFreeMem.
GetMemsNativeIntGetMem and AllocMem.
ReallocMemsNativeIntReallocMem.