Browse Source

--- Merging r14424 into '.':
U rtl/inc/heap.inc
--- Merging r14424 into 'packages/unzip/src/unzip51g.pp':
G packages/unzip/src/unzip51g.pp
--- Merging r14424 into '.':
G .

git-svn-id: tags/release_2_4_0@14426 -

marco 15 years ago
parent
commit
54c3e1ba9d
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