aboutsummaryrefslogtreecommitdiffstats
path: root/thread_pthread.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-06-09 14:42:15 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-06-09 14:42:15 +0000
commit008d621e7d53f76e25e456307124bd087ed91b53 (patch)
tree77dc27dd1f2284ddba15666aaec0f4d20986dfbd /thread_pthread.c
parentd75d0d0fb90b275caad94cabaa90630bb1b50c47 (diff)
downloadruby-008d621e7d53f76e25e456307124bd087ed91b53.tar.gz
thread_pthread.c: workaround for valgrind on Mac
* thread.c: revert r59053. * thread_pthread.c (rb_thread_create_timer_thread): needs more stack space for valgrind. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59055 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread_pthread.c')
-rw-r--r--thread_pthread.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/thread_pthread.c b/thread_pthread.c
index 437ff370d5..f652429637 100644
--- a/thread_pthread.c
+++ b/thread_pthread.c
@@ -1602,9 +1602,17 @@ rb_thread_create_timer_thread(void)
* at least 16KB (4 pages). FreeBSD 8.2 AMD64 causes
* machine stack overflow only with PTHREAD_STACK_MIN.
*/
+ enum {
+ needs_more_stack =
+#if defined HAVE_VALGRIND_MEMCHECK_H && defined __APPLE__
+ 1
+#else
+ THREAD_DEBUG != 0
+#endif
+ };
size_t stack_size = PTHREAD_STACK_MIN; /* may be dynamic, get only once */
if (stack_size < min_size) stack_size = min_size;
- if (THREAD_DEBUG) stack_size += BUFSIZ;
+ if (needs_more_stack) stack_size += BUFSIZ;
pthread_attr_setstacksize(&attr, stack_size);
}
# endif