瀏覽代碼

* 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 年之前
父節點
當前提交
327a15488e
共有 1 個文件被更改,包括 4 次插入1 次删除
  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}