浏览代码

* use HexStr instead of casting to PtrUInt for logging pointers, when
DEBUG_TINY_HEAP is defined, because HexStr produces nicer results for far
pointers

git-svn-id: trunk@28633 -

nickysn 11 年之前
父节点
当前提交
72ba70f7ec
共有 1 个文件被更改,包括 5 次插入5 次删除
  1. 5 5
      rtl/inc/tinyheap.inc

+ 5 - 5
rtl/inc/tinyheap.inc

@@ -161,7 +161,7 @@
               prev^.next := HeapPtr;
               prev^.next := HeapPtr;
           end;
           end;
 {$ifdef DEBUG_TINY_HEAP}
 {$ifdef DEBUG_TINY_HEAP}
-        Writeln(ptruint(Result));
+        Writeln(HexStr(Result));
 {$endif DEBUG_TINY_HEAP}
 {$endif DEBUG_TINY_HEAP}
       end;
       end;
 
 
@@ -229,7 +229,7 @@
         sz: ptruint;
         sz: ptruint;
       begin
       begin
 {$ifdef DEBUG_TINY_HEAP}
 {$ifdef DEBUG_TINY_HEAP}
-        Writeln('SysTinyFreeMem(', ptruint(Addr), ')');
+        Writeln('SysTinyFreeMem(', HexStr(Addr), ')');
 {$endif DEBUG_TINY_HEAP}
 {$endif DEBUG_TINY_HEAP}
         if addr=nil then
         if addr=nil then
           begin
           begin
@@ -268,7 +268,7 @@
         sz: ptruint;
         sz: ptruint;
       begin
       begin
 {$ifdef DEBUG_TINY_HEAP}
 {$ifdef DEBUG_TINY_HEAP}
-        Write('SysTinyReAllocMem(', ptruint(p), ',', size, ')=');
+        Write('SysTinyReAllocMem(', HexStr(p), ',', size, ')=');
 {$endif DEBUG_TINY_HEAP}
 {$endif DEBUG_TINY_HEAP}
         if size=0 then
         if size=0 then
           result := nil
           result := nil
@@ -287,7 +287,7 @@
         SysTinyFreeMem(p);
         SysTinyFreeMem(p);
         p := result;
         p := result;
 {$ifdef DEBUG_TINY_HEAP}
 {$ifdef DEBUG_TINY_HEAP}
-        Writeln(ptruint(result));
+        Writeln(HexStr(result));
 {$endif DEBUG_TINY_HEAP}
 {$endif DEBUG_TINY_HEAP}
       end;
       end;
 
 
@@ -297,7 +297,7 @@
         p: PTinyHeapBlock;
         p: PTinyHeapBlock;
       begin
       begin
 {$ifdef DEBUG_TINY_HEAP}
 {$ifdef DEBUG_TINY_HEAP}
-        Writeln('RegisterTinyHeapBlock(', ptruint(AAddress), ',', ASize, ')');
+        Writeln('RegisterTinyHeapBlock(', HexStr(AAddress), ',', ASize, ')');
 {$endif DEBUG_TINY_HEAP}
 {$endif DEBUG_TINY_HEAP}
         alignment_inc := TTinyHeapPointerArithmeticType(align(AAddress,TinyHeapAllocGranularity))-TTinyHeapPointerArithmeticType(AAddress);
         alignment_inc := TTinyHeapPointerArithmeticType(align(AAddress,TinyHeapAllocGranularity))-TTinyHeapPointerArithmeticType(AAddress);
         Inc(AAddress,alignment_inc);
         Inc(AAddress,alignment_inc);