From 4f131139456edc120612b7264619042fc698f08c Mon Sep 17 00:00:00 2001 From: akr Date: Sat, 15 Dec 2007 04:09:24 +0000 Subject: * vm_core.h (rb_thread_t): new member machine_stack_maxsize and machine_register_stack_maxsize. * gc.c (rb_gc_stack_maxsize): new global variable for the thread size of the main thread. (STACK_LEVEL_MAX): use machine_stack_maxsize of current thread. (ruby_stack_check): check IA64 register stack. (ruby_set_stack_size): set rb_gc_stack_maxsize. (Init_stack): set rb_gc_stack_maxsize. * thread_pthread.ci (native_thread_create): initialize th->machine_stack_maxsize and th->machine_register_stack_maxsize. * vm.c (Init_BareVM): initialize th->machine_stack_maxsize and th->machine_register_stack_maxsize. * thread_win32.ci (native_thread_create): initialize th->machine_stack_maxsize. not tested. just a guess at all. [ruby-dev:32604] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- thread_pthread.ci | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'thread_pthread.ci') diff --git a/thread_pthread.ci b/thread_pthread.ci index 9d5a7d3d79..6cf43dbeb3 100644 --- a/thread_pthread.ci +++ b/thread_pthread.ci @@ -280,13 +280,21 @@ native_thread_create(rb_thread_t *th) } else { pthread_attr_t attr; - size_t stack_size = 1024 * 1024; /* 1024KB */ + size_t stack_size = 512 * 1024; /* 512KB */ + size_t space; #ifdef PTHREAD_STACK_MIN if (stack_size < PTHREAD_STACK_MIN) { stack_size = PTHREAD_STACK_MIN * 2; } #endif + space = stack_size/5; + if (space > 1024*1024) space = 1024*1024; + th->machine_stack_maxsize = stack_size - space; +#ifdef __ia64 + th->machine_stack_maxsize /= 2; + th->machine_register_stack_maxsize = th->machine_stack_maxsize; +#endif CHECK_ERR(pthread_attr_init(&attr)); -- cgit v1.2.3