Index: gc.c =================================================================== --- gc.c (revision 34318) +++ gc.c (working copy) @@ -536,10 +536,19 @@ } #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)