Project

General

Profile

Bug #5901 » smaller-heap-for-openbsd.diff

better fix -- if OpenBSD, set HEAP_SIZE to 4 kilobytes - kernigh (George Koehler), 01/17/2012 09:03 AM

View differences:

gc.c (working copy)
}
#endif
#ifdef __OpenBSD__
/* OpenBSD posix_memalign() is broken. Quoting BUGS in manual:
* "Only alignments up to the page size can be specified."
* Minimal page size is 4KB. */
#define HEAP_ALIGN_LOG 12
#define HEAP_ALIGN 0x1000
#define HEAP_ALIGN_MASK 0x0fff
#else
/* tiny heap size: 16KB */
#define HEAP_ALIGN_LOG 14
#define HEAP_ALIGN 0x4000
#define HEAP_ALIGN_MASK 0x3fff
#endif
#define REQUIRED_SIZE_BY_MALLOC (sizeof(size_t) * 5)
#define HEAP_SIZE (HEAP_ALIGN - REQUIRED_SIZE_BY_MALLOC)
(2-2/3)