]> granicus.if.org Git - gc/commit
Use heap-allocated memory for local mark stack of non-marker thread
authorIvan Maidanski <ivmai@mail.ru>
Tue, 1 Aug 2017 22:13:37 +0000 (01:13 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Wed, 2 Aug 2017 07:32:17 +0000 (10:32 +0300)
commit4601763a7f6e0c9a5feb0e339f271a6585eb8338
treee66d4aab8e375b983363c9bdc3b9176a63f73669
parent3df57b56ecceaf8d838f67dad12f879b837f8736
Use heap-allocated memory for local mark stack of non-marker thread

Issue #159 (bdwgc).

The memory is allocated using GET_MEM to avoid to make sure that
it is not accidentally scanned by the collector.

* include/private/gcconfig.h [!PARALLEL_MARK && THREADS]
(MIN_STACK_SIZE): Do not define.
* include/private/gcconfig.h [PARALLEL_MARK] (MIN_STACK_SIZE): Add
comment.
* mark.c [PARALLEL_MARK] (main_local_mark_stack): New static variable.
* mark.c [PARALLEL_MARK] (GC_wait_for_markers_init): Declare bytes_to_get
local variable; allocate local mark stack (using GET_MEM) and set
main_local_mark_stack (if not yet allocated by the parent process).
* mark [PARALLEL_MARK] (GC_do_parallel_mark): Remove local_mark_stack
huge local variable; use main_local_mark_stack instead of
local_mark_stack.
* pthread_support.c [GC_ASSERTIONS] (WRAP_FUNC(pthread_create)): Use
hard-coded value (65536) instead of MIN_STACK_SIZE in GC_ASSERT.
* tests/test.c [GC_PTHREADS && DEFAULT_STACK_MAYBE_SMALL]
(fork_a_thread): Do not set stack size for the created threads.
* tests/test.c [GC_PTHREADS] (main): Do not check
DEFAULT_STACK_MAYBE_SMALL.
include/private/gcconfig.h
mark.c
pthread_support.c
tests/test.c