ruby-changes:67125
From: Peter <ko1@a...>
Date: Wed, 11 Aug 2021 22:26:39 +0900 (JST)
Subject: [ruby-changes:67125] 79cc566ab4 (master): Make during_compacting flag in GC one bit
https://git.ruby-lang.org/ruby.git/commit/?id=79cc566ab4 From 79cc566ab4cdf75f125ecf413a27d353a9756c08 Mon Sep 17 00:00:00 2001 From: Peter Zhu <peter.zhu@s...> Date: Tue, 10 Aug 2021 19:54:10 -0400 Subject: Make during_compacting flag in GC one bit Commit c32218de1ba094223420a4ea017707f48d0009c5 turned during_compacting flag to 2 bits to support the case when there is no write barrier. But commit 32b7dcfb56a417c1d1c354102351fc1825d653bf changed compaction to always enable the write barrier. This commit cleans up some of the leftover code. --- gc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gc.c b/gc.c index 560eaff..d37f736 100644 --- a/gc.c +++ b/gc.c @@ -715,7 +715,7 @@ typedef struct rb_objspace { https://github.com/ruby/ruby/blob/trunk/gc.c#L715 unsigned int dont_gc : 1; unsigned int dont_incremental : 1; unsigned int during_gc : 1; - unsigned int during_compacting : 2; + unsigned int during_compacting : 1; unsigned int gc_stressful: 1; unsigned int has_hook: 1; unsigned int during_minor_gc : 1; @@ -8915,7 +8915,7 @@ gc_start(rb_objspace_t *objspace, unsigned int reason) https://github.com/ruby/ruby/blob/trunk/gc.c#L8915 objspace->flags.immediate_sweep = !!(reason & GPR_FLAG_IMMEDIATE_SWEEP); /* Explicitly enable compaction (GC.compact) */ - objspace->flags.during_compacting = (!!(reason & GPR_FLAG_COMPACT) << 1); + objspace->flags.during_compacting = !!(reason & GPR_FLAG_COMPACT); if (!heap_allocated_pages) return FALSE; /* heap is not ready */ if (!(reason & GPR_FLAG_METHOD) && !ready_to_gc(objspace)) return TRUE; /* GC is not allowed */ -- cgit v1.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/