* 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
This commit is contained in:
nari 2012-01-31 12:36:50 +00:00
Родитель 487cc8b5ce
Коммит a42cc41ba1
3 изменённых файлов: 33 добавлений и 1 удалений

Просмотреть файл

@ -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

Просмотреть файл

@ -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

4
gc.c
Просмотреть файл

@ -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)