]> granicus.if.org Git - gc/commit
Fix gctest failure if PARALLEL_MARK (musl)
authorPeter Wang <novalazy@gmail.com>
Thu, 22 Jun 2017 21:25:41 +0000 (00:25 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Sun, 2 Jul 2017 06:37:34 +0000 (09:37 +0300)
commit65629822c97dd114c8420d60e0e113e5c37004b5
treee1601846c70729a4057d73ca176bc5eb1a01f1b3
parent1e3ae585e42e8617c9a07a09ea7417ebf1a2bc8a
Fix gctest failure if PARALLEL_MARK (musl)

Issue #159 (bdwgc).

The default stack size of threads in musl is not large enough for
GC with parallel markers enabled.  This commit increases the stack
of the created threads to the required minimum.

* include/private/gcconfig.h [PARALLEL_MARK && (HPUX
|| GC_DGUX386_THREADS || NO_GETCONTEXT)] (DEFAULT_STACK_MAYBE_SMALL):
New macro; add TODO item.
* include/private/gcconfig.h [PARALLEL_MARK || THREADS] (MIN_STACK_SIZE):
New macro.
* pthread_support.c (MIN_STACK_SIZE): Do not define.
* pthread_support.c (GC_start_mark_threads_inner): Check
DEFAULT_STACK_MAYBE_SMALL macro instead of HPUX or GC_DGUX386_THREADS.
* pthread_support.c [DEFAULT_STACK_MAYBE_SMALL]
(GC_start_mark_threads_inner): Do not set stack size if old_size is 0.
* pthread_support.c [GC_ASSERTIONS] (WRAP_FUNC(pthread_create)): Use
MIN_STACK_SIZE in GC_ASSERT.
* tests/test.c [GC_PTHREADS && DEFAULT_STACK_MAYBE_SMALL]
(fork_a_thread): Set stack size of the created thread to MIN_STACK_SIZE.
* tests/test.c [GC_PTHREADS] (main): Set size of the created thread
also if DEFAULT_STACK_MAYBE_SMALL is defined.
include/private/gcconfig.h
pthread_support.c
tests/test.c