在Delphi中,GetMemoryManagerState和ReservedAddressSpace分别是什么意思?

3

我有一段代码,它给了我一些数字。我不知道这些数字是什么意思。我很好奇,这些数字是什么意思。谢谢您的答复!

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;
1个回答

1

这些信息可以在程序文档中找到:TMemoryManagerState。此外,在内存管理索引中还有更多的信息可供参考。

如果您想真正了解FastMM的工作原理,那么您应该下载并阅读源代码。例如,它如下定义了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;

正如您所见,注释记录了字段的信息。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接