Index: configure.in =================================================================== --- configure.in (revision 34399) +++ configure.in (working copy) @@ -1292,7 +1292,12 @@ CFLAGS="$save_CFLAGS"]) AC_DEFINE_UNQUOTED(GC_MARK_STACKFRAME_WORD, $rb_cv_gc_mark_stackframe_word) +AS_CASE(["$target_os"], +[openbsd*], [ + AC_DEFINE_UNQUOTED(HEAP_ALIGN_LOG, 12) + ]) + dnl Checks for library functions. AC_TYPE_GETGROUPS AC_TYPE_SIGNAL Index: gc.c =================================================================== --- gc.c (revision 34399) +++ gc.c (working copy) @@ -536,8 +536,11 @@ } #endif -/* tiny heap size: 16KB */ +#ifndef HEAP_ALIGN_LOG +/* default tiny heap size: 16KB */ #define HEAP_ALIGN_LOG 14 +#endif + #define HEAP_ALIGN (1UL << HEAP_ALIGN_LOG) #define HEAP_ALIGN_MASK (~(~0UL << HEAP_ALIGN_LOG)) #define REQUIRED_SIZE_BY_MALLOC (sizeof(size_t) * 5)