[前][次][番号順一覧][スレッド一覧]

ruby-changes:22355

From: nari <ko1@a...>
Date: Tue, 31 Jan 2012 21:37:00 +0900 (JST)
Subject: [ruby-changes:22355] nari:r34404 (trunk): * configure.in (HEAP_ALIGN_LOG): HEAP_ALIGN_LOG should be page

nari	2012-01-31 21:36:50 +0900 (Tue, 31 Jan 2012)

  New Revision: 34404

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=34404

  Log:
    * configure.in (HEAP_ALIGN_LOG): HEAP_ALIGN_LOG should be page
      size in OpenBSD. [ruby-core:42158][Bug #5901]
    
    * gc.c : avoid to redefine.

  Modified files:
    trunk/ChangeLog
    trunk/configure.in
    trunk/gc.c

Index: configure.in
===================================================================
--- configure.in	(revision 34403)
+++ configure.in	(revision 34404)
@@ -1292,7 +1292,30 @@
 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
 AC_TYPE_SIGNAL
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 34403)
+++ ChangeLog	(revision 34404)
@@ -1,3 +1,10 @@
+Tue Jan 31 21:27:43 2012  Narihiro Nakamura  <authornari@g...>
+
+	* 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@r...>
 
 	* test/ruby/envutil.rb (EnvUtil.invoke_ruby): yield also child pid
Index: gc.c
===================================================================
--- gc.c	(revision 34403)
+++ gc.c	(revision 34404)
@@ -536,8 +536,10 @@
 }
 #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)

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]