From 0d00df6ec5956f7ba8a47f0035a857caaad5cffd Mon Sep 17 00:00:00 2001
From: pierre <pierre@freepascal.org>
Date: Wed, 19 Sep 2012 07:57:31 +0000
Subject: [PATCH]  * Only -dextheaptrc sets keepreleased to tue (meaning no
 memory is really released by heaptrc memory manager)  * -dheaptrc add heaptrc
 as first unit in main source.

git-svn-id: trunk@22424 -
---
 compiler/pp.pas     | 6 +++---
 compiler/ppheap.pas | 4 +++-
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/compiler/pp.pas b/compiler/pp.pas
index 2e81093935..37eb4fde93 100644
--- a/compiler/pp.pas
+++ b/compiler/pp.pas
@@ -170,6 +170,9 @@ program pp;
 {$endif win32}
 
 uses
+{$ifdef heaptrc}
+  ppheap,
+{$endif heaptrc}
 {$ifdef cmem}
   cmem,
 {$endif cmem}
@@ -226,9 +229,6 @@ end;
 begin
   oldexit:=exitproc;
   exitproc:=@myexit;
-{$ifdef extheaptrc}
-  keepreleased:=true;
-{$endif extheaptrc}
 { Call the compiler with empty command, so it will take the parameters }
   Halt(compiler.Compile(''));
 end.
diff --git a/compiler/ppheap.pas b/compiler/ppheap.pas
index 6dfe60066c..6ba6e8fea5 100644
--- a/compiler/ppheap.pas
+++ b/compiler/ppheap.pas
@@ -120,7 +120,7 @@ implementation
       begin
         with pextra_info(p)^ do
          begin
-           writeln(t,getfilename(fileindex)+'('+tostr(line)+','+tostr(col)+') ');
+           writeln(t,'Memory allocated at '+getfilename(fileindex)+'('+tostr(line)+','+tostr(col)+') ');
          end;
       end;
 
@@ -132,7 +132,9 @@ implementation
     begin
        if not pp_heap_inited then
          begin
+{$ifdef extheaptrc}
             keepreleased:=true;
+{$endif extheaptrc}
             SetHeapTraceOutput('heap.log');
             SetHeapExtraInfo(sizeof(textra_info),
                              @set_extra_info,