[boehm] Avoid a ENOMEM when allocating across an unallocated page
commit546a888f91e338149e5a2af9190f6c8696f6abb5
authorGeoff Norton <grompf@sublimeintervention.com>
Fri, 29 Apr 2011 20:23:15 +0000 (29 16:23 -0400)
committerGeoff Norton <grompf@sublimeintervention.com>
Fri, 29 Apr 2011 20:23:15 +0000 (29 16:23 -0400)
treea73b67f3ab0997a7b4a49feeea401700eff964d9
parentb0c3795ac4d3802e1ac5ced33a2d07c9177ca8db
[boehm] Avoid a ENOMEM when allocating across an unallocated page

A very rare allocation pattern could cause the boehm free list to call
the GC_unmap_gap function, which actually calls down into munmap().
Darwins virtual memory manager will return a KERN_INVALID_ADDRESS
which is translated into a ENOMEM, if mprotect attempts to change
the protection of a range which includes an unallocated page.
We address this by just mmap() back to ANON, instead of actually
unallocating the page.
libgc/os_dep.c