summaryrefslogtreecommitdiff
path: root/mark.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2018-04-06 19:45:23 +0300
committerIvan Maidanski <ivmai@mail.ru>2018-04-06 19:45:23 +0300
commit72f159b81640d8e5ab706b4104868eb6d9677fb2 (patch)
tree342c6d6681fa0b6b95685622f8557e3d4797ebb7 /mark.c
parent8fe21d8b12180f77ba6fbd63e7a5aba59685fd0d (diff)
downloadbdwgc-72f159b81640d8e5ab706b4104868eb6d9677fb2.tar.gz
Add assertions about held lock for apply_to_each_object callers
(code refactoring of commit 5e6cc59b0) * alloc.c (GC_stopped_mark, GC_finish_collection): Add assertion (at the beginning of the function) that the allocation lock is held. * backgraph.c [MAKE_BACK_GRAPH] (GC_build_back_graph, GC_traverse_back_graph): Likewise. * mark.c (GC_initiate_gc): Likewise. * alloc.c (GC_stopped_mark): Remove comment about the held lock (because there is an assertion about it).
Diffstat (limited to 'mark.c')
-rw-r--r--mark.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/mark.c b/mark.c
index d8b69e5f..8dd257f3 100644
--- a/mark.c
+++ b/mark.c
@@ -259,6 +259,7 @@ GC_INNER void GC_clear_marks(void)
/* mark state is invalid. */
GC_INNER void GC_initiate_gc(void)
{
+ GC_ASSERT(I_HOLD_LOCK());
# ifndef GC_DISABLE_INCREMENTAL
if (GC_incremental) {
# ifdef CHECKSUMS