Implemented a resizable heap abstraction over mmap(). Allows us to
grow or shrink the heap according to demand, without having to move objects.
Initially we reserve a large contigious region of virtual memory. However, no
actual swap space or physical memory is reserved/allocated for this region. We can
do this using the MAP_NORESERVE flag for mmap(). The rationale for reserving
this memory is to prevent other code in the process (think of third-party plugins)
from using virtual memory in this region (and thus preventing us from growing the heap).
We can commit or decommit memory using st_heap_grow() or st_heap_shrink()
respectively. Committing memory will usually result in swap space or physical memory
being allocated. All this code is in `st-memory.h'.
Added portable wrapper functions in `st-system.h' which wrap over the
virtual memory primitives for win32 and posix.
38 files changed: