Project

General

Profile

Bug #13438 ยป 0001-Remove-HEAP_ALIGN_LOG-setting-in-configure.ac-for-Op.patch

jeremyevans0 (Jeremy Evans), 06/06/2018 07:30 PM

View differences:

configure.ac
1568 1568
  AC_DEFINE_UNQUOTED(STACK_END_ADDRESS, $rb_cv_stack_end_address)
1569 1569
])
1570 1570

  
1571
# posix_memalign(memptr, alignment, size) implemented for OpenBSD 4.8 doesn't work if alignment > MALLOC_PAGESIZE.
1572
# [ruby-core:42158] https://bugs.ruby-lang.org/issues/5901
1573
# OpenBSD 5.2 fixed the problem. (src/lib/libc/stdlib/malloc.c:1.142)
1574
# MirOS #10semel has the problem but fixed in the repository.  (src/lib/libc/stdlib/malloc.c:1.9)
1575
AS_CASE(["$target_os"],
1576
[openbsd*|mirbsd*], [
1577
  AC_CACHE_CHECK(for heap align log on openbsd, rb_cv_page_size_log,
1578
    [rb_cv_page_size_log=no
1579
     for page_log in 12 13; do
1580
       AC_TRY_RUN([
1581
#include <math.h>
1582
#include <unistd.h>
1583

  
1584
int
1585
main() {
1586
  if ((int)log2((double)sysconf(_SC_PAGESIZE)) != $page_log) return 1;
1587
  return 0;
1588
}
1589
       ],
1590
       rb_cv_page_size_log="$page_log"; break)
1591
     done])
1592
  AS_IF([test $rb_cv_page_size_log != no], [
1593
    AC_DEFINE_UNQUOTED(HEAP_ALIGN_LOG, $rb_cv_page_size_log)
1594
  ], [
1595
    AC_DEFINE_UNQUOTED(HEAP_ALIGN_LOG, 12)
1596
  ])
1597
])
1598

  
1599 1571
dnl Checks for library functions.
1600 1572
AC_TYPE_GETGROUPS
1601 1573
AC_TYPE_SIGNAL
gc.c
656 656
} rb_objspace_t;
657 657

  
658 658

  
659
#ifndef HEAP_PAGE_ALIGN_LOG
660 659
/* default tiny heap size: 16KB */
661 660
#define HEAP_PAGE_ALIGN_LOG 14
662
#endif
663 661
#define CEILDIV(i, mod) (((i) + (mod) - 1)/(mod))
664 662
enum {
665 663
    HEAP_PAGE_ALIGN = (1UL << HEAP_PAGE_ALIGN_LOG),
666
-