summaryrefslogtreecommitdiff
path: root/proc.c
diff options
context:
space:
mode:
authorAaron Patterson <tenderlove@ruby-lang.org>2020-11-02 14:40:29 -0800
committerAaron Patterson <tenderlove@ruby-lang.org>2020-11-02 14:42:48 -0800
commit67b2c21c327c96d80b8a0fe02a96d417e85293e8 (patch)
treec4ea1236016fc2b7e40582a69966d35c5f8c7289 /proc.c
parent79b242260bc0530503dde85eda8e79b1c2aa9a6e (diff)
downloadruby-67b2c21c327c96d80b8a0fe02a96d417e85293e8.tar.gz
Add `GC.auto_compact= true/false` and `GC.auto_compact`
* `GC.auto_compact=`, `GC.auto_compact` can be used to control when compaction runs. Setting `auto_compact=` to true will cause compaction to occurr duing major collections. At the moment, compaction adds significant overhead to major collections, so please test first! [Feature #17176]
Diffstat (limited to 'proc.c')
-rw-r--r--proc.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/proc.c b/proc.c
index 5c78fc10ed..1ac07b10a4 100644
--- a/proc.c
+++ b/proc.c
@@ -67,7 +67,7 @@ block_mark(const struct rb_block *block)
RUBY_MARK_MOVABLE_UNLESS_NULL(captured->self);
RUBY_MARK_MOVABLE_UNLESS_NULL((VALUE)captured->code.val);
if (captured->ep && captured->ep[VM_ENV_DATA_INDEX_ENV] != Qundef /* cfunc_proc_t */) {
- RUBY_MARK_MOVABLE_UNLESS_NULL(VM_ENV_ENVVAL(captured->ep));
+ rb_gc_mark(VM_ENV_ENVVAL(captured->ep));
}
}
break;
@@ -90,9 +90,6 @@ block_compact(struct rb_block *block)
struct rb_captured_block *captured = &block->as.captured;
captured->self = rb_gc_location(captured->self);
captured->code.val = rb_gc_location(captured->code.val);
- if (captured->ep && captured->ep[VM_ENV_DATA_INDEX_ENV] != Qundef /* cfunc_proc_t */) {
- UPDATE_REFERENCE(captured->ep[VM_ENV_DATA_INDEX_ENV]);
- }
}
break;
case block_type_symbol: