瀏覽代碼

* 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 -

pierre 13 年之前
父節點
當前提交
0d00df6ec5
共有 2 個文件被更改,包括 6 次插入4 次删除
  1. 3 3
      compiler/pp.pas
  2. 3 1
      compiler/ppheap.pas

+ 3 - 3
compiler/pp.pas

@@ -170,6 +170,9 @@ program pp;
 {$endif win32}
 {$endif win32}
 
 
 uses
 uses
+{$ifdef heaptrc}
+  ppheap,
+{$endif heaptrc}
 {$ifdef cmem}
 {$ifdef cmem}
   cmem,
   cmem,
 {$endif cmem}
 {$endif cmem}
@@ -226,9 +229,6 @@ end;
 begin
 begin
   oldexit:=exitproc;
   oldexit:=exitproc;
   exitproc:=@myexit;
   exitproc:=@myexit;
-{$ifdef extheaptrc}
-  keepreleased:=true;
-{$endif extheaptrc}
 { Call the compiler with empty command, so it will take the parameters }
 { Call the compiler with empty command, so it will take the parameters }
   Halt(compiler.Compile(''));
   Halt(compiler.Compile(''));
 end.
 end.

+ 3 - 1
compiler/ppheap.pas

@@ -120,7 +120,7 @@ implementation
       begin
       begin
         with pextra_info(p)^ do
         with pextra_info(p)^ do
          begin
          begin
-           writeln(t,getfilename(fileindex)+'('+tostr(line)+','+tostr(col)+') ');
+           writeln(t,'Memory allocated at '+getfilename(fileindex)+'('+tostr(line)+','+tostr(col)+') ');
          end;
          end;
       end;
       end;
 
 
@@ -132,7 +132,9 @@ implementation
     begin
     begin
        if not pp_heap_inited then
        if not pp_heap_inited then
          begin
          begin
+{$ifdef extheaptrc}
             keepreleased:=true;
             keepreleased:=true;
+{$endif extheaptrc}
             SetHeapTraceOutput('heap.log');
             SetHeapTraceOutput('heap.log');
             SetHeapExtraInfo(sizeof(textra_info),
             SetHeapExtraInfo(sizeof(textra_info),
                              @set_extra_info,
                              @set_extra_info,