2
0
Эх сурвалжийг харах

* allocate always a minimum block size, else free list management causes memory corruption

git-svn-id: trunk@34930 -
florian 8 жил өмнө
parent
commit
16fa079a2a

+ 4 - 1
rtl/embedded/heapmgr.pp

@@ -49,7 +49,10 @@ Unit heapmgr;
         p, prev: PHeapBlock;
         AllocSize, RestSize: ptruint;
       begin
-        AllocSize := align(size+sizeof(pointer), sizeof(pointer));
+        if size<MinBlock then
+          AllocSize := MinBlock
+        else
+          AllocSize := align(size, sizeof(pointer));
 
         p := Blocks;
         prev := nil;