|
@@ -30,6 +30,12 @@ type
|
|
procedure getheapstatus(var status:THeapStatus);
|
|
procedure getheapstatus(var status:THeapStatus);
|
|
{$endif HASGETHEAPSTATUS}
|
|
{$endif HASGETHEAPSTATUS}
|
|
|
|
|
|
|
|
+{$ifndef HASGETFPCHEAPSTATUS}
|
|
|
|
+ type
|
|
|
|
+ TFPCHeapStatus = THeapStatus;
|
|
|
|
+ function GetFPCHeapStatus:TFPCHeapStatus;
|
|
|
|
+{$endif HASGETFPCHEAPSTATUS}
|
|
|
|
+
|
|
function DoMem (Var StartMem : sizeint): sizeint;
|
|
function DoMem (Var StartMem : sizeint): sizeint;
|
|
|
|
|
|
|
|
|
|
@@ -114,6 +120,15 @@ end;
|
|
end;
|
|
end;
|
|
{$endif HASGETHEAPSTATUS}
|
|
{$endif HASGETHEAPSTATUS}
|
|
|
|
|
|
|
|
+{$ifndef HASGETFPCHEAPSTATUS}
|
|
|
|
+ function GetFPCHeapStatus:TFPCHeapStatus;
|
|
|
|
+ begin
|
|
|
|
+ GetHeapStatus(GetFPCHeapStatus);
|
|
|
|
+ end;
|
|
|
|
+{$endif HASGETFPCHEAPSTATUS}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
|
|
function DoMem (Var StartMem : sizeint): sizeint;
|
|
function DoMem (Var StartMem : sizeint): sizeint;
|
|
|
|
|
|
@@ -132,9 +147,9 @@ function DoMem (Var StartMem : sizeint): sizeint;
|
|
end;
|
|
end;
|
|
|
|
|
|
var
|
|
var
|
|
- hstatus : THeapstatus;
|
|
|
|
|
|
+ hstatus : TFPCHeapstatus;
|
|
begin
|
|
begin
|
|
- GetHeapStatus(hstatus);
|
|
|
|
|
|
+ hstatus:=GetFPCHeapStatus;
|
|
if StartMem=0 then
|
|
if StartMem=0 then
|
|
begin
|
|
begin
|
|
Writeln ('[HEAP] Size: ',getsize(hstatus.CurrHeapSize),', Used: ',getsize(hstatus.CurrHeapUsed));
|
|
Writeln ('[HEAP] Size: ',getsize(hstatus.CurrHeapSize),', Used: ',getsize(hstatus.CurrHeapUsed));
|