summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2023-05-03 20:49:06 +0300
committerIvan Maidanski <ivmai@mail.ru>2023-05-03 20:49:06 +0300
commit33776199da186407dac0109e9097884d0b755722 (patch)
tree42fb6497f75700adb9871555a26f3c7d93a8a2cb
parent2bd99806ec080e06a5f8712a8e7e6c14b1bda23c (diff)
downloadbdwgc-33776199da186407dac0109e9097884d0b755722.tar.gz
Do not do unnecessary GC_read_dirty() from GC_enable_incremental
* misc.c [!GC_DISABLE_INCREMENTAL && !KEEP_BACK_PTRS] (GC_enable_incremental): Do not call GC_read_dirty() if GC_bytes_allocd is non-zero. * misc.c [!GC_DISABLE_INCREMENTAL && !KEEP_BACK_PTRS && !CHECKSUMS] (GC_enable_incremental): Pass TRUE (output_unneeded) to GC_read_dirty().
-rw-r--r--misc.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/misc.c b/misc.c
index e6005fd8..3b6dda83 100644
--- a/misc.c
+++ b/misc.c
@@ -1437,11 +1437,16 @@ GC_API void GC_CALL GC_enable_incremental(void)
if (GC_bytes_allocd > 0) {
/* There may be unmarked reachable objects. */
GC_gcollect_inner();
- }
- /* else we're OK in assuming everything's */
+ } else {
+ /* We are OK in assuming everything is */
/* clean since nothing can point to an */
/* unmarked object. */
- GC_read_dirty(FALSE);
+# ifdef CHECKSUMS
+ GC_read_dirty(FALSE);
+# else
+ GC_read_dirty(TRUE);
+# endif
+ }
RESTORE_CANCEL(cancel_state);
}
}