From c4c79e256bed22592c7faf9aa83cf7a943edd8a2 Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 8 Jun 2012 23:30:55 +0000 Subject: 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 --- thread_pthread.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'thread_pthread.c') 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; } } -- cgit v1.2.3