ruby-changes:25020
From: nobu <ko1@a...>
Date: Wed, 3 Oct 2012 15:33:27 +0900 (JST)
Subject: [ruby-changes:25020] nobu:r37072 (trunk): thread_pthread.c: init stack with ulimit
nobu 2012-10-03 15:33:08 +0900 (Wed, 03 Oct 2012) New Revision: 37072 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=37072 Log: thread_pthread.c: init stack with ulimit * thread_pthread.c (ruby_init_stack): use getrlimit() for the main thread on Mac OS X, since pthread_get_stack{addr,size}_np() and return the default value always, but not the ulimit value. [ruby-dev:46174] [Bug #7084] Modified files: trunk/ChangeLog trunk/thread_pthread.c Index: ChangeLog =================================================================== --- ChangeLog (revision 37071) +++ ChangeLog (revision 37072) @@ -1,3 +1,10 @@ +Wed Oct 3 15:33:02 2012 Nobuyoshi Nakada <nobu@r...> + + * thread_pthread.c (ruby_init_stack): use getrlimit() for the main + thread on Mac OS X, since pthread_get_stack{addr,size}_np() and + return the default value always, but not the ulimit value. + [ruby-dev:46174] [Bug #7084] + Wed Oct 3 11:43:15 2012 Nobuyoshi Nakada <nobu@r...> * io.c (rb_io_reopen): improvement to accept optional arguments. Index: thread_pthread.c =================================================================== --- thread_pthread.c (revision 37071) +++ thread_pthread.c (revision 37072) @@ -492,6 +492,8 @@ #define STACKADDR_AVAILABLE 1 #elif defined HAVE_PTHREAD_GET_STACKADDR_NP && defined HAVE_PTHREAD_GET_STACKSIZE_NP #define STACKADDR_AVAILABLE 1 +#undef MAINSTACKADDR_AVAILABLE +#define MAINSTACKADDR_AVAILABLE 0 void *pthread_get_stackaddr_np(pthread_t); size_t pthread_get_stacksize_np(pthread_t); #elif defined HAVE_THR_STKSEGMENT || defined HAVE_PTHREAD_STACKSEG_NP @@ -500,6 +502,14 @@ #define STACKADDR_AVAILABLE 1 #endif +#ifndef MAINSTACKADDR_AVAILABLE +# ifdef STACKADDR_AVAILABLE +# define MAINSTACKADDR_AVAILABLE 1 +# else +# define MAINSTACKADDR_AVAILABLE 0 +# endif +#endif + #ifdef STACKADDR_AVAILABLE /* * Get the initial address and size of current thread's stack @@ -614,7 +624,7 @@ { size_t size = 0; size_t space = 0; -#if defined(STACKADDR_AVAILABLE) +#if MAINSTACKADDR_AVAILABLE void* stackaddr; STACK_GROW_DIR_DETECTION; get_stack(&stackaddr, &size); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/