summaryrefslogtreecommitdiff
path: root/reclaim.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2022-04-01 09:05:05 +0300
committerIvan Maidanski <ivmai@mail.ru>2022-04-01 09:05:05 +0300
commit5d6eca9e9df050f6295cdf33560f171388a66a60 (patch)
treea6e3b47d924269ccd5833bf3173e57b84dc5ce5f /reclaim.c
parentdbcff3bb14748e6798700f094ccb2771b7160160 (diff)
downloadbdwgc-5d6eca9e9df050f6295cdf33560f171388a66a60.tar.gz
Ensure GC lock is held in add_leaked/smashed and check_heap_proc
(refactoring) * dbg_mlc.c [!SHORT_DBG_HDRS] (GC_add_smashed, GC_check_heap_proc): Assert that the GC lock is held (I_HOLD_LOCK). * reclaim.c (GC_add_leaked): Likewise. * dbg_mlc.c [!SHORT_DBG_HDRS] (GC_check_heap_proc): Remove "I hold lock" from comment not to duplicate the assertion.
Diffstat (limited to 'reclaim.c')
-rw-r--r--reclaim.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/reclaim.c b/reclaim.c
index c79868cc..532ccb32 100644
--- a/reclaim.c
+++ b/reclaim.c
@@ -57,6 +57,7 @@ STATIC unsigned GC_n_leaked = 0;
GC_INLINE void GC_add_leaked(ptr_t leaked)
{
+ GC_ASSERT(I_HOLD_LOCK());
# ifndef SHORT_DBG_HDRS
if (GC_findleak_delay_free && !GC_check_leaked(leaked))
return;