From 0f1a9218fe2716c0438d3ae6ea445b7ac09f5a8b Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 23 Nov 2009 07:06:54 +0000 Subject: * thread_pthread.c (RUBY_STACK_MIN, RUBY_STACK_SPACE): delay for platforms where PTHREAD_STACK_MIN is not compile time constant. [ruby-dev:39751] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25889 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- thread_pthread.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'thread_pthread.c') diff --git a/thread_pthread.c b/thread_pthread.c index c8ee4e127..0d37a1213 100644 --- a/thread_pthread.c +++ b/thread_pthread.c @@ -463,15 +463,17 @@ enum { #else RUBY_STACK_MIN_LIMIT = 512 * 1024, /* 512KB */ #endif - RUBY_STACK_MIN = ( + RUBY_STACK_SPACE_LIMIT = 1024 * 1024 +}; + #ifdef PTHREAD_STACK_MIN - (RUBY_STACK_MIN_LIMIT < PTHREAD_STACK_MIN) ? PTHREAD_STACK_MIN * 2 : +#define RUBY_STACK_MIN ((RUBY_STACK_MIN_LIMIT < PTHREAD_STACK_MIN) ? \ + PTHREAD_STACK_MIN * 2 : RUBY_STACK_MIN_LIMIT) +#else +#define RUBY_STACK_MIN (RUBY_STACK_MIN_LIMIT) #endif - RUBY_STACK_MIN_LIMIT), - RUBY_STACK_SPACE_LIMIT = 1024 * 1024, - RUBY_STACK_SPACE = (RUBY_STACK_MIN/5 > RUBY_STACK_SPACE_LIMIT ? - RUBY_STACK_SPACE_LIMIT : RUBY_STACK_MIN/5) -}; +#define RUBY_STACK_SPACE (RUBY_STACK_MIN/5 > RUBY_STACK_SPACE_LIMIT ? \ + RUBY_STACK_SPACE_LIMIT : RUBY_STACK_MIN/5) static int native_thread_create(rb_thread_t *th) -- cgit