summaryrefslogtreecommitdiff
path: root/thread_pthread.c
diff options
context:
space:
mode:
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) {