mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 16:44:01 +02:00
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]
This commit is contained in:
parent
79b242260b
commit
67b2c21c32
9 changed files with 810 additions and 376 deletions
5
proc.c
5
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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue