2013-04-12 51 views
2

我有一個代碼,並給了我一些數字。我不知道這些數字意味着什麼。我很好奇,這些數字是什麼意思。謝謝您的回答!是什麼GetMemoryManagerState,ReservedAddressSpace做德爾福?

procedure usdmem(var stradd,stpadd:array of Integer); 
var 
st: TMemoryManagerState; 
sb: TSmallBlockTypeState; 
i:Integer; 
begin 
GetMemoryManagerState(st); 
i:=0; 
for sb in st.SmallBlockTypeStates do 
begin 
    stradd[i]:=sb.ReservedAddressSpace; 
    stpadd[i]:=stradd[i]+sb.UseableBlockSize*8; 
    inc(i); 
end; 
end; 
//----------------------------------- 
usdmem(stradd,stpadd); 
for I := 0 to 10 do 
begin 
    Write(inttostr(stradd[I])); 
    Write(' - '); 
    WriteLn(inttostr(stpadd[I])); 
end; 

回答

0

該信息可以在程序文檔中找到:TMemoryManagerState。在Memory Management Index的許多主題索引中還有更多信息可用。

如果你想真正瞭解FastMM是如何工作的,那麼你應該download and read the source。例如,定義TSmallBlockTypeState像這樣:

TSmallBlockTypeState = record 
    {The internal size of the block type} 
    InternalBlockSize: Cardinal; 
    {Useable block size: The number of non-reserved bytes inside the block.} 
    UseableBlockSize: Cardinal; 
    {The number of allocated blocks} 
    AllocatedBlockCount: NativeUInt; 
    {The total address space reserved for this block type (both allocated and 
    free blocks)} 
    ReservedAddressSpace: NativeUInt; 
end; 

正如你可以看到,註釋文檔記錄的字段。