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;
4

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

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

于 2013-04-12T11:37:58.570 回答