Browse Source

* another problme with realloc fixed (one left)

Jonas Maebe 25 years ago
parent
commit
adcc8f25b7
1 changed files with 7 additions and 3 deletions
  1. 7 3
      rtl/inc/heaptrc.pp

+ 7 - 3
rtl/inc/heaptrc.pp

@@ -767,12 +767,13 @@ var
 begin
 begin
   if not assigned(p) then
   if not assigned(p) then
    begin
    begin
+     { only when a new block has to be allocated, the getmem_cnt increases! }
+     inc(getmem_cnt);
      p:=TraceGetMem(size);
      p:=TraceGetMem(size);
      TraceReallocMem:=P;
      TraceReallocMem:=P;
      exit;
      exit;
    end;
    end;
    dec(p,sizeof(theap_mem_info)+extra_info_size);
    dec(p,sizeof(theap_mem_info)+extra_info_size);
-  { remove heap_mem_info from linked list }
   pp:=pheap_mem_info(p);
   pp:=pheap_mem_info(p);
   if pp^.next<>nil then
   if pp^.next<>nil then
    pp^.next^.previous:=pp^.previous;
    pp^.next^.previous:=pp^.previous;
@@ -803,6 +804,7 @@ begin
       traceReAllocMem := p;
       traceReAllocMem := p;
       exit;
       exit;
     end;
     end;
+  { remove heap_mem_info from linked list }
 { Create the info block }
 { Create the info block }
   pheap_mem_info(p)^.sig:=$DEADBEEF;
   pheap_mem_info(p)^.sig:=$DEADBEEF;
   pheap_mem_info(p)^.size:=size;
   pheap_mem_info(p)^.size:=size;
@@ -837,7 +839,6 @@ begin
   if usecrc then
   if usecrc then
     pheap_mem_info(p)^.sig:=calculate_sig(pheap_mem_info(p));
     pheap_mem_info(p)^.sig:=calculate_sig(pheap_mem_info(p));
   inc(p,sizeof(theap_mem_info)+extra_info_size);
   inc(p,sizeof(theap_mem_info)+extra_info_size);
-  inc(getmem_cnt);
   TraceReAllocmem:=p;
   TraceReAllocmem:=p;
 end;
 end;
 
 
@@ -965,7 +966,10 @@ finalization
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.34  2000-01-20 12:35:35  jonas
+  Revision 1.35  2000-01-20 13:17:11  jonas
+    * another problme with realloc fixed (one left)
+
+  Revision 1.34  2000/01/20 12:35:35  jonas
     * fixed problem with reallocmem and heaptrc
     * fixed problem with reallocmem and heaptrc
 
 
   Revision 1.33  2000/01/07 16:41:34  daniel
   Revision 1.33  2000/01/07 16:41:34  daniel