Ver código fonte

Make HeapMgr.GetAlignedMem public. This function is useful for embedded targets where alignment > 32(or sizeof(pointer)) bytes is required.
Fix RegisterHeapBlock. Calling FreeMem requires the heap manager to be installed, plus it requires the size of the segment to be stored in front of the pointer. Instead use InternalFreeMem

git-svn-id: trunk@29611 -

Jeppe Johansen 11 anos atrás
pai
commit
85c5e7330a
1 arquivos alterados com 3 adições e 1 exclusões
  1. 3 1
      rtl/embedded/heapmgr.pp

+ 3 - 1
rtl/embedded/heapmgr.pp

@@ -18,6 +18,8 @@ Unit heapmgr;
   interface
   interface
 
 
     procedure RegisterHeapBlock(AAddress: pointer; ASize: ptruint);
     procedure RegisterHeapBlock(AAddress: pointer; ASize: ptruint);
+    
+    function GetAlignedMem(Size, Alignment: ptruint): pointer;
 
 
   implementation
   implementation
 
 
@@ -220,7 +222,7 @@ Unit heapmgr;
 
 
     procedure RegisterHeapBlock(AAddress: pointer; ASize: ptruint);
     procedure RegisterHeapBlock(AAddress: pointer; ASize: ptruint);
       begin
       begin
-        FreeMem(AAddress, ASize);
+        InternalFreeMem(AAddress, ASize);
       end;
       end;
 
 
     const
     const