summaryrefslogtreecommitdiff
path: root/reclaim.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2017-08-22 01:09:59 +0300
committerIvan Maidanski <ivmai@mail.ru>2017-08-22 01:09:59 +0300
commit207ba534acd38fd1acd722e02a07cc33e09720c8 (patch)
treef6d59b4d383b7be2aa4ba5d368a97104dbd794f4 /reclaim.c
parentf5e3318adf3c8e31fb1dd314a323281c5fa3c3f2 (diff)
downloadbdwgc-207ba534acd38fd1acd722e02a07cc33e09720c8.tar.gz
Eliminate unsigned fl_builder_count underflow in mark_thread
(refactor commit 0ca6d3f) * include/private/gc_priv.h [PARALLEL_MARK] (GC_fl_builder_count): Change type from word to signed_word. * reclaim.c [PARALLEL_MARK] (GC_fl_builder_count): Likewise. * mark.c [PARALLEL_MARK] (GC_wait_for_markers_init): Change type of count local variable to signed_word; add assertion that count is non-negative. * pthread_support.c [PARALLEL_MARK] (GC_mark_thread): Add comment that GC_fl_builder_count can be negative here. * win32_threads.c [PARALLEL_MARK] (GC_mark_thread): Likewise. * reclaim.c [PARALLEL_MARK] (GC_fl_builder_count): Refine comment.
Diffstat (limited to 'reclaim.c')
-rw-r--r--reclaim.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/reclaim.c b/reclaim.c
index 2f491218..5bd69979 100644
--- a/reclaim.c
+++ b/reclaim.c
@@ -28,10 +28,11 @@ GC_INNER signed_word GC_bytes_found = 0;
/* on free lists which we had to drop. */
#if defined(PARALLEL_MARK)
- GC_INNER word GC_fl_builder_count = 0;
+ GC_INNER signed_word GC_fl_builder_count = 0;
/* Number of threads currently building free lists without */
/* holding GC lock. It is not safe to collect if this is */
- /* nonzero. */
+ /* nonzero. Also, together with the mark lock, it is used as */
+ /* a semaphore during marker threads startup. */
#endif /* PARALLEL_MARK */
/* We defer printing of leaked objects until we're done with the GC */