fpc/packages/amunits/examples/checkmem.pas
marco 88851f7852 * amunits moved
git-svn-id: trunk@10043 -
2008-01-27 13:16:04 +00:00

31 lines
595 B
ObjectPascal

program checkmem;
uses exec, amigados;
var
chipfirst,
chipsecond,
fastfirst,
fastsecond : longint;
begin
if ParamCount <> 1 then begin
writeln('Usage: CheckMem ProgramName');
halt(10);
end;
chipfirst := AvailMem(MEMF_CHIP);
fastfirst := AvailMem(MEMF_FAST);
if Execute(ParamStr(1),0,0) then begin
chipsecond := AvailMem(MEMF_CHIP);
fastsecond := AvailMem(MEMF_FAST);
writeln('Memory loss (Chip): ',chipsecond-chipfirst);
writeln('Memory loss (Fast): ',fastsecond-fastfirst);
halt;
end else writeln('Could''t run the program');
end.