Replace explicit recursion by heap allocations
in sexp_mark_one code.
This prevents crashes caused by stack overflow.
In particular, fixes issue #601.
As an optimization, allocate a fixed sized stack buffer first,
which should be enough for "normal" uses.
When that stack overflows, switch to heap.
Also, store "ranges" on the stack, instead of the actual sexp's,
using the fact that sexp's of a single parent are continous in memory.
This patch doesn't remove recursion on the context saves
because it didn't seem like they overflow in practice.
But changing that is simple having the stack interface.
Using read/write/exec causes an error (or possibly abort) on systems
with W^X policies (like OpenBSD and NetBSD have by default).
Since the heap does not need to be executable, just use read/write.
When mmap fails it returns MAP_FAILED, not NULL. POSIX does not
define the value for MAP_FAILED, but on at least the BSDs and Linux
its value is ((void *) -1).
Try to fix win32 port. Now it runs both on Win32/Win64.
Win64 port currently depends on 128bits arithmetic thus it does not run on
MSVC.
Makefile now have EXCLUDE_POSIX_LIBS knob to exclude posix related library
from build.
Introduce msys PLATFORM for Makefile.detect to use MSYS's POSIX
emulation layer. It is intended for linking against MSYS tools; it is
not for embedding to Win32 applications.