Browse Source

+ SysGetMem: Add DEBUG_TINY_HEAP message after SysAlloc call.
* Change InternalTinyAlign procedure:
Change variable ASize to be VAR parameter type
so that possible size reduction required by alignment
is propagated correctly to calling function.

git-svn-id: trunk@36297 -

pierre 8 years ago
parent
commit
0f80603dae
1 changed files with 4 additions and 1 deletions
  1. 4 1
      rtl/inc/tinyheap.inc

+ 4 - 1
rtl/inc/tinyheap.inc

@@ -157,6 +157,9 @@
                        end
                      else }
                        begin
+{$ifdef DEBUG_TINY_HEAP}
+                         Writeln('SysAlloc returned: ',HexStr(p));
+{$endif DEBUG_TINY_HEAP}
                          RegisterTinyHeapBlock(p,AllocSize);
                          { Recursive call }
                          SysGetMem:=SysGetMem(Size);
@@ -501,7 +504,7 @@
         FreeList := p;
       end;
 
-    procedure InternalTinyAlign(var AAddress: Pointer; ASize: PtrUInt);
+    procedure InternalTinyAlign(var AAddress: Pointer; var ASize: {$ifdef FPC_TINYHEAP_HUGE}LongInt{$else}PtrUInt{$endif});
       var
         alignment_inc: smallint;
       begin