diff options
author | Peter Zhu <[email protected]> | 2024-05-03 12:00:24 -0400 |
---|---|---|
committer | Peter Zhu <[email protected]> | 2024-07-03 09:03:40 -0400 |
commit | 51bd816517941798c63e587a5a9f3caf69cd510e (patch) | |
tree | c0ad93459be4e0ae63f3e8ed3f56f93bda581a0c /imemo.c | |
parent | 9aa62bda46bf7f9de91a95c31fa09dafd23def37 (diff) |
[Feature #20470] Split GC into gc_impl.c
This commit splits gc.c into two files:
- gc.c now only contains code not specific to Ruby GC. This includes
code to mark objects (which the GC implementation may choose not to
use) and wrappers for internal APIs that the implementation may need
to use (e.g. locking the VM).
- gc_impl.c now contains the implementation of Ruby's GC. This includes
marking, sweeping, compaction, and statistics. Most importantly,
gc_impl.c only uses public APIs in Ruby and a limited set of functions
exposed in gc.c. This allows us to build gc_impl.c independently of
Ruby and plug Ruby's GC into itself.
Diffstat (limited to 'imemo.c')
-rw-r--r-- | imemo.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -214,7 +214,7 @@ rb_cc_table_mark(VALUE klass) static bool moved_or_living_object_strictly_p(VALUE obj) { - return obj && (rb_objspace_markable_object_p(obj) || BUILTIN_TYPE(obj) == T_MOVED); + return obj && (!rb_objspace_garbage_object_p(obj) || BUILTIN_TYPE(obj) == T_MOVED); } static void @@ -457,7 +457,7 @@ vm_ccs_free(struct rb_class_cc_entries *ccs, int alive, VALUE klass) if (!alive) { void *ptr = asan_unpoison_object_temporary((VALUE)cc); // ccs can be free'ed. - if (rb_objspace_markable_object_p((VALUE)cc) && + if (!rb_objspace_garbage_object_p((VALUE)cc) && IMEMO_TYPE_P(cc, imemo_callcache) && cc->klass == klass) { // OK. maybe target cc. |