diff options
author | Peter Zhu <peter@peterzhu.ca> | 2023-11-27 11:13:47 -0500 |
---|---|---|
committer | Peter Zhu <peter@peterzhu.ca> | 2023-11-27 11:13:47 -0500 |
commit | e3875dd0f8f11d9dbdc25b400f387c406b799cb5 (patch) | |
tree | f7e22fc90544b0d77be6cace0868b433830bed59 /gc.c | |
parent | 7973eb7c3f6531a41adb9de63d1b3c4d5d4b7d03 (diff) | |
download | ruby-e3875dd0f8f11d9dbdc25b400f387c406b799cb5.tar.gz |
Don't incremental mark when GC stressful
Incremental marking prevents the GC from fully executing, so it may fail
to catch certain bugs.
Diffstat (limited to 'gc.c')
-rw-r--r-- | gc.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -9404,7 +9404,6 @@ static int gc_start(rb_objspace_t *objspace, unsigned int reason) { unsigned int do_full_mark = !!(reason & GPR_FLAG_FULL_MARK); - unsigned int immediate_mark = reason & GPR_FLAG_IMMEDIATE_MARK; /* reason may be clobbered, later, so keep set immediate_sweep here */ objspace->flags.immediate_sweep = !!(reason & GPR_FLAG_IMMEDIATE_SWEEP); @@ -9449,7 +9448,9 @@ gc_start(rb_objspace_t *objspace, unsigned int reason) reason |= GPR_FLAG_MAJOR_BY_FORCE; /* GC by CAPI, METHOD, and so on. */ } - if (objspace->flags.dont_incremental || immediate_mark) { + if (objspace->flags.dont_incremental || + reason & GPR_FLAG_IMMEDIATE_MARK || + ruby_gc_stressful) { objspace->flags.during_incremental_marking = FALSE; } else { |