Browse Source

--- Merging r14419 into '.':
U rtl/inc/heap.inc

git-svn-id: branches/fixes_2_4@14424 -

marco 15 years ago
parent
commit
1b4639ae7e
1 changed files with 5 additions and 1 deletions
  1. 5 1
      rtl/inc/heap.inc

+ 5 - 1
rtl/inc/heap.inc

@@ -1251,6 +1251,7 @@ var
   oldsize,
   currsize : ptruint;
   pcurr : pmemchunk_var;
+  loc_freelists : pfreelists;
 begin
   SysTryResizeMem := false;
 
@@ -1297,7 +1298,10 @@ begin
     end;
 
   { get pointer to block }
+  loc_freelists := @freelists;
   pcurr := pmemchunk_var(pointer(p)-sizeof(tmemchunk_var_hdr));
+  if pcurr^.freelists <> loc_freelists then
+    exit;
   oldsize := currsize;
 
   { do we need to allocate more memory ? }
@@ -1315,7 +1319,7 @@ begin
   if currsize>size then
     currsize := split_block(pcurr, size);
 
-  with pcurr^.freelists^.internal_status do
+  with loc_freelists^.internal_status do
   begin
     inc(currheapused, currsize-oldsize);
     if currheapused > maxheapused then