From 91799e57a56542b830ac2fe5a68d7210d30ffbbd Mon Sep 17 00:00:00 2001 From: Jeremy Evans Date: Tue, 18 Apr 2017 16:37:05 -0700 Subject: [PATCH] Remove overriding of HEAP_PAGE_ALIGN_LOG HEAP_ALIGN_LOG was renamed to HEAP_PAGE_ALIGN_LOG over a year ago in gc.c, but not in configure.in. Since then, configure.in has been setting an unused variable. So removing this code from configure.in shouldn't break anything that hasn't already been broken for a year. The only operating systems that needed this code were released at least 5 years ago (OpenBSD 5.1). --- configure.in | 28 ---------------------------- gc.c | 2 -- 2 files changed, 30 deletions(-) diff --git a/configure.in b/configure.in index 74f79b35d2..f908c1c933 100644 --- a/configure.in +++ b/configure.in @@ -2221,34 +2221,6 @@ if test $rb_cv_stack_end_address != no; then AC_DEFINE_UNQUOTED(STACK_END_ADDRESS, $rb_cv_stack_end_address) fi -# posix_memalign(memptr, alignment, size) implemented for OpenBSD 4.8 doesn't work if alignment > MALLOC_PAGESIZE. -# [ruby-core:42158] https://bugs.ruby-lang.org/issues/5901 -# OpenBSD 5.2 fixed the problem. (src/lib/libc/stdlib/malloc.c:1.142) -# MirOS #10semel has the problem but fixed in the repository. (src/lib/libc/stdlib/malloc.c:1.9) -AS_CASE(["$target_os"], -[openbsd*|mirbsd*], [ - AC_CACHE_CHECK(for heap align log on openbsd, rb_cv_page_size_log, - [rb_cv_page_size_log=no - for page_log in 12 13; do - AC_TRY_RUN([ -#include -#include - -int -main() { - if ((int)log2((double)sysconf(_SC_PAGESIZE)) != $page_log) return 1; - return 0; -} - ], - rb_cv_page_size_log="$page_log"; break) - done]) - if test $rb_cv_page_size_log != no; then - AC_DEFINE_UNQUOTED(HEAP_ALIGN_LOG, $rb_cv_page_size_log) - else - AC_DEFINE_UNQUOTED(HEAP_ALIGN_LOG, 12) - fi -]) - dnl Checks for library functions. AC_TYPE_GETGROUPS AC_TYPE_SIGNAL diff --git a/gc.c b/gc.c index ce80ccff7f..eb22079418 100644 --- a/gc.c +++ b/gc.c @@ -640,10 +640,8 @@ typedef struct rb_objspace { } rb_objspace_t; -#ifndef HEAP_PAGE_ALIGN_LOG /* default tiny heap size: 16KB */ #define HEAP_PAGE_ALIGN_LOG 14 -#endif #define CEILDIV(i, mod) (((i) + (mod) - 1)/(mod)) enum { HEAP_PAGE_ALIGN = (1UL << HEAP_PAGE_ALIGN_LOG), -- 2.11.0