summaryrefslogtreecommitdiff
path: root/thread_pthread.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-06-08 23:30:55 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-06-08 23:30:55 +0000
commitc4c79e256bed22592c7faf9aa83cf7a943edd8a2 (patch)
tree8829448be56289a1c2bfbb82e3b417f81cd1a481 /thread_pthread.c
parent5b2df41b35f70c2abc4fc1ef430311e3967e999a (diff)
thread_pthread.c: use stack info
* thread_pthread.c (ruby_init_stack): use stack info if possible. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35978 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread_pthread.c')
-rw-r--r--thread_pthread.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/thread_pthread.c b/thread_pthread.c
index bfff385292..10c7a83dd3 100644
--- a/thread_pthread.c
+++ b/thread_pthread.c
@@ -607,7 +607,7 @@ ruby_init_stack(volatile VALUE *addr
{
size_t size = 0;
size_t space = 0;
-#if defined(HAVE_PTHREAD_ATTR_GET_NP)
+#if defined(STACKADDR_AVAILABLE)
void* addr;
get_stack(&addr, &size);
#elif defined(HAVE_GETRLIMIT)
@@ -615,8 +615,8 @@ ruby_init_stack(volatile VALUE *addr
if (getrlimit(RLIMIT_STACK, &rlim) == 0) {
size = (size_t)rlim.rlim_cur;
}
-#endif
space = size > 5 * 1024 * 1024 ? 1024 * 1024 : size / 5;
+#endif
native_main_thread.stack_maxsize = size - space;
}
}