-
- if ( (base_non_committed == 0) ||
- (next_request + size > base_non_committed + SIZE_RESERVED_POOL) ) {
-#ifdef ENABLE_WIN32_DLL_SUPPORT
- if (base_non_committed)
- barf("Windows programs can only use 128Mb of heap; sorry!");
-#endif
+
+ if ( (base_non_committed == 0) || (next_request + size > end_non_committed) ) {
+ if (base_non_committed) {
+ barf("RTS exhausted max heap size (%d bytes)\n", size_reserved_pool);
+ }
+ if (RtsFlags.GcFlags.maxHeapSize != 0) {
+ size_reserved_pool = BLOCK_SIZE * RtsFlags.GcFlags.maxHeapSize;
+ if (size_reserved_pool < MBLOCK_SIZE) {
+ size_reserved_pool = 2*MBLOCK_SIZE;
+ }
+ }