summaryrefslogtreecommitdiff
path: root/thread_pthread.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-06-10 08:54:28 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-06-10 08:54:28 +0000
commit35c96b9003ee6c5a6af02113216ff37f7d1ebbaa (patch)
tree568ba8b2f68d6f06406008ae60c3d12b67c91f9e /thread_pthread.c
parent8fdd48d69fc41123e99da7761981d3c12eefc8d7 (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.c5
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) {