Browse Source

* generate a run time error 203 in the tiny heap in case there's not enough
memory for a memory allocation and ReturnNilIfGrowHeapFails is false

git-svn-id: trunk@25727 -

nickysn 12 years ago
parent
commit
327a15488e
1 changed files with 4 additions and 1 deletions
  1. 4 1
      rtl/inc/tinyheap.inc

+ 4 - 1
rtl/inc/tinyheap.inc

@@ -75,7 +75,10 @@
               InternalTinyFreeMem(pointer(ptruint(p)+AllocSize), RestSize);
           end
         else
-          Result := nil;
+          if ReturnNilIfGrowHeapFails then
+            Result := nil
+          else
+            HandleError(203);
 {$ifdef DEBUG_TINY_HEAP}
         Writeln(ptruint(Result));
 {$endif DEBUG_TINY_HEAP}