mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 21:49:18 +02:00
* Fix for 28578
git-svn-id: trunk@31434 -
This commit is contained in:
parent
621c9c357c
commit
1fd2735198
@ -30,6 +30,7 @@ interface
|
|||||||
{$endif}
|
{$endif}
|
||||||
|
|
||||||
Procedure DumpHeap;
|
Procedure DumpHeap;
|
||||||
|
Procedure DumpHeap(SkipIfNoLeaks : Boolean);
|
||||||
|
|
||||||
{ define EXTRA to add more
|
{ define EXTRA to add more
|
||||||
tests :
|
tests :
|
||||||
@ -85,6 +86,8 @@ const
|
|||||||
printleakedblock: boolean = false;
|
printleakedblock: boolean = false;
|
||||||
printfaultyblock: boolean = false;
|
printfaultyblock: boolean = false;
|
||||||
maxprintedblocklength: integer = 128;
|
maxprintedblocklength: integer = 128;
|
||||||
|
|
||||||
|
GlobalSkipIfNoLeaks : Boolean = False;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
@ -1106,6 +1109,12 @@ end;
|
|||||||
*****************************************************************************}
|
*****************************************************************************}
|
||||||
|
|
||||||
procedure dumpheap;
|
procedure dumpheap;
|
||||||
|
|
||||||
|
begin
|
||||||
|
DumpHeap(GlobalSkipIfNoLeaks);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure dumpheap(SkipIfNoLeaks : Boolean);
|
||||||
var
|
var
|
||||||
pp : pheap_mem_info;
|
pp : pheap_mem_info;
|
||||||
i : ptrint;
|
i : ptrint;
|
||||||
@ -1120,6 +1129,8 @@ begin
|
|||||||
else
|
else
|
||||||
ptext:=textoutput;
|
ptext:=textoutput;
|
||||||
pp:=loc_info^.heap_mem_root;
|
pp:=loc_info^.heap_mem_root;
|
||||||
|
if ((loc_info^.getmem_size-loc_info^.freemem_size)=0) and SkipIfNoLeaks then
|
||||||
|
exit;
|
||||||
Writeln(ptext^,'Heap dump by heaptrc unit');
|
Writeln(ptext^,'Heap dump by heaptrc unit');
|
||||||
Writeln(ptext^,loc_info^.getmem_cnt, ' memory blocks allocated : ',
|
Writeln(ptext^,loc_info^.getmem_cnt, ' memory blocks allocated : ',
|
||||||
loc_info^.getmem_size,'/',loc_info^.getmem8_size);
|
loc_info^.getmem_size,'/',loc_info^.getmem8_size);
|
||||||
@ -1517,6 +1528,8 @@ begin
|
|||||||
haltonerror:=false;
|
haltonerror:=false;
|
||||||
if pos('haltonnotreleased',s)>0 then
|
if pos('haltonnotreleased',s)>0 then
|
||||||
HaltOnNotReleased :=true;
|
HaltOnNotReleased :=true;
|
||||||
|
if pos('skipifnoleaks',s)>0 then
|
||||||
|
GlobalSkipIfNoLeaks :=true;
|
||||||
i:=pos('log=',s);
|
i:=pos('log=',s);
|
||||||
if i>0 then
|
if i>0 then
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user