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
This commit is contained in:
parent
1b6e7a3de2
commit
e8c6254680
3
thread.c
3
thread.c
@ -77,9 +77,6 @@
|
|||||||
#define RUBY_THREAD_PRIORITY_MIN -3
|
#define RUBY_THREAD_PRIORITY_MIN -3
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined HAVE_VALGRIND_MEMCHECK_H && __APPLE__
|
|
||||||
#define THREAD_DEBUG -1
|
|
||||||
#endif
|
|
||||||
#ifndef THREAD_DEBUG
|
#ifndef THREAD_DEBUG
|
||||||
#define THREAD_DEBUG 0
|
#define THREAD_DEBUG 0
|
||||||
#endif
|
#endif
|
||||||
|
@ -1602,9 +1602,17 @@ rb_thread_create_timer_thread(void)
|
|||||||
* at least 16KB (4 pages). FreeBSD 8.2 AMD64 causes
|
* at least 16KB (4 pages). FreeBSD 8.2 AMD64 causes
|
||||||
* machine stack overflow only with PTHREAD_STACK_MIN.
|
* 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 */
|
size_t stack_size = PTHREAD_STACK_MIN; /* may be dynamic, get only once */
|
||||||
if (stack_size < min_size) stack_size = min_size;
|
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);
|
pthread_attr_setstacksize(&attr, stack_size);
|
||||||
}
|
}
|
||||||
# endif
|
# endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user