diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2018-04-06 19:45:23 +0300 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2018-04-06 19:45:23 +0300 |
commit | 72f159b81640d8e5ab706b4104868eb6d9677fb2 (patch) | |
tree | 342c6d6681fa0b6b95685622f8557e3d4797ebb7 /backgraph.c | |
parent | 8fe21d8b12180f77ba6fbd63e7a5aba59685fd0d (diff) | |
download | bdwgc-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 'backgraph.c')
-rw-r--r-- | backgraph.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/backgraph.c b/backgraph.c index 64fc92f9..89d5f9b9 100644 --- a/backgraph.c +++ b/backgraph.c @@ -357,6 +357,7 @@ static void add_back_edges(ptr_t p, size_t n_bytes, word gc_descr) /* Does not examine mark bits. Can be called before GC. */ GC_INNER void GC_build_back_graph(void) { + GC_ASSERT(I_HOLD_LOCK()); GC_apply_to_each_object(add_back_edges); } @@ -463,6 +464,7 @@ STATIC word GC_max_max_height = 0; GC_INNER void GC_traverse_back_graph(void) { + GC_ASSERT(I_HOLD_LOCK()); GC_max_height = 0; GC_apply_to_each_object(update_max_height); if (0 != GC_deepest_obj) |