summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2020-12-03 14:09:18 -0500
committerAaron Patterson <aaron.patterson@gmail.com>2020-12-03 11:58:05 -0800
commit88bb1a672c49746972f4b15410fa92e9d237c43d (patch)
treedc627e1f56227ee23f14762017c138eabf4cfb88 /gc.c
parent04b96fc322fe6547d2587f5ccbe0a835af93e48d (diff)
Skip repeated scan of object during compaction
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3843
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gc.c b/gc.c
index 306ad0e257..c5ba3e7436 100644
--- a/gc.c
+++ b/gc.c
@@ -4484,7 +4484,7 @@ try_move(rb_objspace_t *objspace, rb_heap_t *heap, struct heap_page *sweep_page,
objspace->rcompactor.total_moved++;
gc_move(objspace, (VALUE)p, dest);
gc_pin(objspace, (VALUE)p);
- heap->compact_cursor_index = i;
+ heap->compact_cursor_index = i + 1;
if (from_freelist) {
FL_SET((VALUE)p, FL_FROM_FREELIST);
}