[MLton] Re: [MLton-user] Re: fork() in MLton on Cygwin

Stephen Weeks MLton@mlton.org
Tue, 17 Aug 2004 11:10:06 -0700

> I checked in a fix to gc.c to use mmap on Cygwin.  I left in the old
> stuff and used an #ifdef so that we can switch back or use
> VirtualAlloc on other platforms if we need.

When running some self compiles on Cygwin yesterday, I observed that
Cygwin's emulation of mmap does not make available as much contiguous
virtual address space as the Windows VirtualAlloc function.  This
makes running programs with big heaps impossible -- and hence a self
compile is not possible.  So, I switched back to using
Virtual{Alloc,Free} on Cygwin.  And, since we're back to using
VirtualAlloc, I have once again disabled fork.
Perhaps we could some day use a run-time switch to allow the user to
choose at runtime between mmap and VirtualAlloc.  Of course, if the
compiled program used fork, we would require the runtime to use mmap.