Project

General

Profile

Bug #13438 ยป 0001-Remove-overriding-of-HEAP_PAGE_ALIGN_LOG.patch

jeremyevans0 (Jeremy Evans), 04/18/2017 11:47 PM

View differences:

configure.in
2221 2221
  AC_DEFINE_UNQUOTED(STACK_END_ADDRESS, $rb_cv_stack_end_address)
2222 2222
fi
2223 2223

  
2224
# posix_memalign(memptr, alignment, size) implemented for OpenBSD 4.8 doesn't work if alignment > MALLOC_PAGESIZE.
2225
# [ruby-core:42158] https://bugs.ruby-lang.org/issues/5901
2226
# OpenBSD 5.2 fixed the problem. (src/lib/libc/stdlib/malloc.c:1.142)
2227
# MirOS #10semel has the problem but fixed in the repository.  (src/lib/libc/stdlib/malloc.c:1.9)
2228
AS_CASE(["$target_os"],
2229
[openbsd*|mirbsd*], [
2230
  AC_CACHE_CHECK(for heap align log on openbsd, rb_cv_page_size_log,
2231
    [rb_cv_page_size_log=no
2232
     for page_log in 12 13; do
2233
       AC_TRY_RUN([
2234
#include <math.h>
2235
#include <unistd.h>
2236

  
2237
int
2238
main() {
2239
  if ((int)log2((double)sysconf(_SC_PAGESIZE)) != $page_log) return 1;
2240
  return 0;
2241
}
2242
       ],
2243
       rb_cv_page_size_log="$page_log"; break)
2244
     done])
2245
  if test $rb_cv_page_size_log != no; then
2246
    AC_DEFINE_UNQUOTED(HEAP_ALIGN_LOG, $rb_cv_page_size_log)
2247
  else
2248
    AC_DEFINE_UNQUOTED(HEAP_ALIGN_LOG, 12)
2249
  fi
2250
])
2251

  
2252 2224
dnl Checks for library functions.
2253 2225
AC_TYPE_GETGROUPS
2254 2226
AC_TYPE_SIGNAL
gc.c
640 640
} rb_objspace_t;
641 641

  
642 642

  
643
#ifndef HEAP_PAGE_ALIGN_LOG
644 643
/* default tiny heap size: 16KB */
645 644
#define HEAP_PAGE_ALIGN_LOG 14
646
#endif
647 645
#define CEILDIV(i, mod) (((i) + (mod) - 1)/(mod))
648 646
enum {
649 647
    HEAP_PAGE_ALIGN = (1UL << HEAP_PAGE_ALIGN_LOG),
650
-