Commit a69fa544 authored by Ben Gamari's avatar Ben Gamari Committed by Ben Gamari

rts/posix: Ensure that memory commit succeeds

Previously we wouldn't check that mmap would succeed. I suspect this may
have been the cause of #14329.

Test Plan: Validate under low-memory condition

Reviewers: simonmar, austin, erikd

Reviewed By: simonmar

Subscribers: rwbarton, thomie

GHC Trac Issues: #14329

Differential Revision: https://phabricator.haskell.org/D4075
parent c5da84db
......@@ -534,7 +534,10 @@ void *osReserveHeapMemory(void *startAddressPtr, W_ *len)
void osCommitMemory(void *at, W_ size)
{
my_mmap(at, size, MEM_COMMIT);
void *r = my_mmap(at, size, MEM_COMMIT);
if (r == NULL) {
barf("Unable to commit %d bytes of memory", size);
}
}
void osDecommitMemory(void *at, W_ size)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment