From 218bfbfa67e665897b57259b367a8ded16a2c095 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Thu, 30 Nov 2017 01:10:20 +0300 Subject: [PATCH] Fix assertion violation about disabled cancel in try_to_collect_inner * misc.c [!GC_DISABLE_INCREMENTAL && !KEEP_BACK_PTRS] (GC_enable_incremental): Wrap GC_gcollect_inner and GC_read_dirty calls into DISABLE/RESTORE_CANCEL. --- misc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/misc.c b/misc.c index 231d7d18..e28fbfff 100644 --- a/misc.c +++ b/misc.c @@ -1319,6 +1319,9 @@ GC_API void GC_CALL GC_enable_incremental(void) } if (GC_incremental && !GC_dont_gc) { /* Can't easily do it if GC_dont_gc. */ + IF_CANCEL(int cancel_state;) + + DISABLE_CANCEL(cancel_state); if (GC_bytes_allocd > 0) { /* There may be unmarked reachable objects. */ GC_gcollect_inner(); @@ -1327,6 +1330,7 @@ GC_API void GC_CALL GC_enable_incremental(void) /* clean since nothing can point to an */ /* unmarked object. */ GC_read_dirty(FALSE); + RESTORE_CANCEL(cancel_state); } } UNLOCK(); -- 2.50.1