Skip to content

Commit

Permalink
Merge pull request #11781 from Octachron/allocation_and_page_faults
Browse files Browse the repository at this point in the history
documentation: comment on heap allocation on Linux
  • Loading branch information
abbysmal committed Dec 6, 2022
2 parents 693e9c4 + f7b0a7b commit 944baa0
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions runtime/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,12 +250,9 @@ void* caml_mem_commit(void* mem, uintnat size)
#else
void* p = map_fixed(mem, size, PROT_READ | PROT_WRITE);
/*
FIXME: On Linux, with overcommit, you stand a better
chance of getting good error messages in OOM conditions
by forcing the kernel to allocate actual memory by touching
all the pages. Not sure whether this is a good idea, though.
if (p) memset(p, 0, size);
FIXME: On Linux, it might be useful to populate page tables with
MAP_POPULATE to reduce the time spent blocking on page faults at
a later point.
*/
return p;
#endif
Expand Down

0 comments on commit 944baa0

Please sign in to comment.