summaryrefslogtreecommitdiff
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
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
-rw-r--r--ChangeLog4
-rw-r--r--thread_pthread.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index ecf5350231..84bfa9e25a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Sat Jun 9 08:30:52 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * thread_pthread.c (ruby_init_stack): use stack info if possible.
+
Sat Jun 9 08:21:32 2012 Eric Hodel <drbrain@segment7.net>
* README.EXT (prepare extconf.rb): Added note to see MakeMakefile for
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;
}
}