diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2018-03-15 23:16:36 +0300 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2018-03-15 23:16:36 +0300 |
commit | d194e44fec13f92baefe66c2e2f14521627a9679 (patch) | |
tree | c041f1b7c26709eee730c1b5cbdd39c69274a419 /finalize.c | |
parent | cb963c22aa03c2d6f664ef8d7880852559d52ffd (diff) | |
download | bdwgc-d194e44fec13f92baefe66c2e2f14521627a9679.tar.gz |
Add assertions to ensure ADD_CALL_CHAIN is called holding the lock
(code refactoring)
* alloc.c (GC_collect_a_little_inner, GC_allocobj): Add assertion that
the allocation lock is held.
* dbg_mlc.c (GC_store_debug_info_inner): Likewise.
* dbg_mlc.c [DBG_HDRS_ALL] (GC_debug_generic_malloc_inner,
GC_debug_generic_malloc_inner_ignore_off_page): Likewise.
* finalize.c [!GC_TOGGLE_REFS_NOT_NEEDED] (ensure_toggleref_capacity):
Likewise.
* specific.c [USE_CUSTOM_SPECIFIC] (GC_key_create_inner): Likewise.
* alloc.c (GC_allocobj): Remove comment (about the lock).
* dbg_mlc.c [DBG_HDRS_ALL] (GC_debug_generic_malloc_inner): Likewise.
Diffstat (limited to 'finalize.c')
-rw-r--r-- | finalize.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -400,6 +400,7 @@ GC_API int GC_CALL GC_unregister_disappearing_link(void * * link) static GC_bool ensure_toggleref_capacity(int capacity_inc) { GC_ASSERT(capacity_inc >= 0); + GC_ASSERT(I_HOLD_LOCK()); if (NULL == GC_toggleref_arr) { GC_toggleref_array_capacity = 32; /* initial capacity */ GC_toggleref_arr = (GCToggleRef *)GC_INTERNAL_MALLOC_IGNORE_OFF_PAGE( |