diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-06-10 08:54:28 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-06-10 08:54:28 +0000 |
commit | 35c96b9003ee6c5a6af02113216ff37f7d1ebbaa (patch) | |
tree | 568ba8b2f68d6f06406008ae60c3d12b67c91f9e /thread_pthread.c | |
parent | 8fdd48d69fc41123e99da7761981d3c12eefc8d7 (diff) |
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
Diffstat (limited to 'thread_pthread.c')
-rw-r--r-- | thread_pthread.c | 5 |
1 files changed, 3 insertions, 2 deletions
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) { |