Browse Source

* fixed heap block start and size alignment in RegisterTinyHeapBlock

git-svn-id: trunk@24519 -
nickysn 12 years ago
parent
commit
9312419ce8
1 changed files with 3 additions and 1 deletions
  1. 3 1
      rtl/inc/tinyheap.inc

+ 3 - 1
rtl/inc/tinyheap.inc

@@ -230,11 +230,13 @@
 {$ifdef DEBUG_TINY_HEAP}
         Writeln('RegisterTinyHeapBlock(', ptruint(AAddress), ',', ASize, ')');
 {$endif DEBUG_TINY_HEAP}
-        if (ptruint(AAddress) and 1) = 0 then
+        if (ptruint(AAddress) and 1) <> 0 then
           begin
             Inc(AAddress);
             Dec(ASize);
           end;
+        if (ASize and 1) <> 0 then
+          Dec(ASize);
         pptruint(AAddress)^ := ASize - SizeOf(ptruint);
         FreeMem(pptruint(AAddress) + 1, ASize - SizeOf(ptruint));
       end;