summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2020-07-23 11:14:53 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-07-26 13:23:59 -0400
commitda7269a4472856ba701d956a247599f721e9915e (patch)
tree622b6a5d77e8450f338b2462f41cba26a239e0ae
parenta7c4439a407ad85b76aab9301fda61e7c10183ff (diff)
downloadhaskell-da7269a4472856ba701d956a247599f721e9915e.tar.gz
rts/win32: Exit with EXIT_HEAPOVERFLOW if memory commit fails
Since switching to the two-step allocator, the `outofmem` test fails via `osCommitMemory` failing to commit. However, this was previously exiting with `EXIT_FAILURE`, rather than `EXIT_HEAPOVERFLOW`. I think the latter is a more reasonable exit code for this case and matches the behavior on POSIX platforms.
-rw-r--r--rts/win32/OSMem.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/rts/win32/OSMem.c b/rts/win32/OSMem.c
index fd26d06c4e..dd53f4d589 100644
--- a/rts/win32/OSMem.c
+++ b/rts/win32/OSMem.c
@@ -472,7 +472,7 @@ void osCommitMemory (void *at, W_ size)
temp = VirtualAlloc(at, size, MEM_COMMIT, PAGE_READWRITE);
if (temp == NULL) {
sysErrorBelch("osCommitMemory: VirtualAlloc MEM_COMMIT failed");
- stg_exit(EXIT_FAILURE);
+ stg_exit(EXIT_HEAPOVERFLOW);
}
}