diff options
author | Aaron Patterson <tenderlove@ruby-lang.org> | 2019-05-31 13:25:24 -0700 |
---|---|---|
committer | Aaron Patterson <tenderlove@ruby-lang.org> | 2019-06-11 09:16:14 -0700 |
commit | 6db2d6d8520f88e25d97af77495eb6c879f90b21 (patch) | |
tree | 25c42ae8e1a14a019a37401d65ad32f10aa506c6 /variable.c | |
parent | c4cbaef216ffcc9bda70cc328a805ad679ccaa8c (diff) |
Add compaction support for more types.
This commit adds compaction support for:
* Fibers
* Continuations
* Autoload Constants
Diffstat (limited to 'variable.c')
-rw-r--r-- | variable.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/variable.c b/variable.c index ebfdf0dcce..be0eee1df3 100644 --- a/variable.c +++ b/variable.c @@ -1913,13 +1913,23 @@ static const rb_data_type_t autoload_data_i_type = { }; static void +autoload_c_compact(void *ptr) +{ + struct autoload_const *ac = ptr; + + ac->mod = rb_gc_location(ac->mod); + ac->ad = rb_gc_location(ac->ad); + ac->value = rb_gc_location(ac->value); +} + +static void autoload_c_mark(void *ptr) { struct autoload_const *ac = ptr; - rb_gc_mark(ac->mod); - rb_gc_mark(ac->ad); - rb_gc_mark(ac->value); + rb_gc_mark_no_pin(ac->mod); + rb_gc_mark_no_pin(ac->ad); + rb_gc_mark_no_pin(ac->value); } static void @@ -1938,7 +1948,7 @@ autoload_c_memsize(const void *ptr) static const rb_data_type_t autoload_const_type = { "autoload_const", - {autoload_c_mark, autoload_c_free, autoload_c_memsize,}, + {autoload_c_mark, autoload_c_free, autoload_c_memsize, autoload_c_compact,}, 0, 0, RUBY_TYPED_FREE_IMMEDIATELY }; |