+ easier debug when memory is lost

This commit is contained in:
pierre 2000-05-03 16:31:22 +00:00
parent 934883569a
commit dfbb141d2b

View File

@ -152,6 +152,22 @@ begin
end; end;
{$endif USEEXCEPT} {$endif USEEXCEPT}
{$ifdef EXTDEBUG}
{$ifdef FPC}
Var
LostMemory : longint;
Procedure CheckMemory(LostMemory : longint);
begin
if LostMemory<>0 then
begin
Writeln('Memory Lost = '+tostr(LostMemory));
{$ifdef DEBUG}
def_gdb_stop(V_Warning);
{$endif DEBUG}
end;
end;
{$endif FPC}
{$endif EXTDEBUG}
{**************************************************************************** {****************************************************************************
Compiler Compiler
****************************************************************************} ****************************************************************************}
@ -322,7 +338,8 @@ begin
DoneVerbose; DoneVerbose;
{$ifdef EXTDEBUG} {$ifdef EXTDEBUG}
{$ifdef FPC} {$ifdef FPC}
Writeln('Memory Lost = '+tostr(system.HeapSize-MemAvail-EntryMemUsed)); LostMemory:=system.HeapSize-MemAvail-EntryMemUsed;
CheckMemory(LostMemory);
{$endif FPC} {$endif FPC}
{$ifndef newcg} {$ifndef newcg}
Writeln('Repetitive firstpass = '+tostr(firstpass_several)+'/'+tostr(total_of_firstpass)); Writeln('Repetitive firstpass = '+tostr(firstpass_several)+'/'+tostr(total_of_firstpass));
@ -341,7 +358,10 @@ end;
end. end.
{ {
$Log$ $Log$
Revision 1.48 2000-04-05 21:18:04 pierre Revision 1.49 2000-05-03 16:31:22 pierre
+ easier debug when memory is lost
Revision 1.48 2000/04/05 21:18:04 pierre
* set NOUSEEXCEPT to remove use of setjump/longjump * set NOUSEEXCEPT to remove use of setjump/longjump
Revision 1.47 2000/03/18 15:05:33 jonas Revision 1.47 2000/03/18 15:05:33 jonas