From 35c96b9003ee6c5a6af02113216ff37f7d1ebbaa Mon Sep 17 00:00:00 2001 From: nobu Date: Sun, 10 Jun 2012 08:54:28 +0000 Subject: [PATCH] thread_pthread.c: adjust stack size * thread_pthread.c (ruby_init_stack): adjust stack size for offset of addr from the bottom. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36013 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ thread_pthread.c | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 79d618b254..71fd8e3097 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sun Jun 10 17:54:26 2012 Nobuyoshi Nakada + + * thread_pthread.c (ruby_init_stack): adjust stack size for offset of + addr from the bottom. + Sun Jun 10 15:49:47 2012 Tanaka Akira * process.c (retry_fork): call after_fork except in a child process. diff --git a/thread_pthread.c b/thread_pthread.c index 10c7a83dd3..8a77d70144 100644 --- a/thread_pthread.c +++ b/thread_pthread.c @@ -608,8 +608,9 @@ ruby_init_stack(volatile VALUE *addr size_t size = 0; size_t space = 0; #if defined(STACKADDR_AVAILABLE) - void* addr; - get_stack(&addr, &size); + void* stackaddr; + get_stack(&stackaddr, &size); + space = STACK_DIR_UPPER((char *)addr - (char *)stackaddr, (char *)stackaddr - (char *)addr); #elif defined(HAVE_GETRLIMIT) struct rlimit rlim; if (getrlimit(RLIMIT_STACK, &rlim) == 0) {