mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
This commit is contained in:
parent
5b2df41b35
commit
c4c79e256b
2 changed files with 6 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue