]> granicus.if.org Git - gc/commitdiff
Fix assertion violation about disabled cancel in try_to_collect_inner
authorIvan Maidanski <ivmai@mail.ru>
Wed, 29 Nov 2017 22:10:20 +0000 (01:10 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Wed, 29 Nov 2017 22:10:20 +0000 (01:10 +0300)
* 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

diff --git a/misc.c b/misc.c
index 231d7d18273310637d46e1474cb2bb4f6528ec51..e28fbfff0e6cc4fade46e364bf2ba4887f51101e 100644 (file)
--- 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();