diff options
author | nari <nari@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-01-31 12:36:50 +0000 |
---|---|---|
committer | nari <nari@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-01-31 12:36:50 +0000 |
commit | a42cc41ba1abacd37e1922965fae641e537a6b5f (patch) | |
tree | 897311e051fbe623a45a7cdac218c27ef285e54b | |
parent | 487cc8b5cebfcdfe218058ff9de31d2231e1d5cb (diff) | |
download | ruby-a42cc41ba1abacd37e1922965fae641e537a6b5f.tar.gz |
* configure.in (HEAP_ALIGN_LOG): HEAP_ALIGN_LOG should be page
size in OpenBSD. [ruby-core:42158][Bug #5901]
* gc.c : avoid to redefine.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34404 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | configure.in | 23 | ||||
-rw-r--r-- | gc.c | 4 |
3 files changed, 33 insertions, 1 deletions
@@ -1,3 +1,10 @@ +Tue Jan 31 21:27:43 2012 Narihiro Nakamura <authornari@gmail.com> + + * configure.in (HEAP_ALIGN_LOG): HEAP_ALIGN_LOG should be page + size in OpenBSD. [ruby-core:42158][Bug #5901] + + * gc.c : avoid to redefine. + Tue Jan 31 14:27:22 2012 Nobuyoshi Nakada <nobu@ruby-lang.org> * test/ruby/envutil.rb (EnvUtil.invoke_ruby): yield also child pid diff --git a/configure.in b/configure.in index 085dfcfa20..2b56b749d4 100644 --- a/configure.in +++ b/configure.in @@ -1292,6 +1292,29 @@ main() { CFLAGS="$save_CFLAGS"]) AC_DEFINE_UNQUOTED(GC_MARK_STACKFRAME_WORD, $rb_cv_gc_mark_stackframe_word) +AS_CASE(["$target_os"], +[openbsd*], [ + 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 <math.h> +#include <unistd.h> + +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 @@ -536,8 +536,10 @@ rb_objspace_free(rb_objspace_t *objspace) } #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) |