summaryrefslogtreecommitdiff
path: root/gc_impl.c
AgeCommit message (Collapse)Author
2024-07-11Move gc_impl.c to gc/gc_impl.cPeter Zhu
This commit creates a new directory `gc` to put different GC implementations and moves the default GC from gc_impl.c to gc/gc_impl.c. The default GC can be easily switched using the `BUILTIN_GC` variable in Makefile.in.
2024-07-10GC_DEBUG is always defined卜部昌平
`#ifdef` is inadequate.
2024-07-10rb_source_location_cstr is banned in this file卜部昌平
Raison d'etre du gc_impl.c is to purge any internal constructs and rely solely on our public APIs. rb_source_location_cstr is not public.
2024-07-10rb_gc_obj_slot_size is banned in this file卜部昌平
Raison d'etre du gc_impl.c is to purge any internal constructs and rely solely on our public APIs. rb_gc_obj_slot_size is not public.
2024-07-08Rename rb_gc_impl_verify_internal_consistency to gc_verify_internal_consistencyPeter Zhu
It's an internal function so we can drop the rb_gc_impl
2024-07-08Make rb_gc_impl_verify_internal_consistency staticPeter Zhu
The function is not used outside of this file.
2024-07-04Fix RUBY_FREE_AT_EXIT with ASANPeter Zhu
When Ruby is built with ASAN and RUBY_FREE_AT_EXIT is enabled, the following error occurs: READ of size 8 at 0x74c666610020 thread T0 #0 0x593b6712ecc6 in RB_BUILTIN_TYPE include/ruby/internal/value_type.h:191:30 #1 0x593b6712ecc6 in rb_gc_impl_shutdown_free_objects gc_impl.c:3208:17 #2 0x593b6749a62e in ruby_vm_destruct vm.c:3133:17
2024-07-03Fix ASAN buildsPeter Zhu
2024-07-03Fix compilation with RGENGC_CHECK_MODE=2Peter Zhu
2024-07-03[Feature #20470] Split GC into gc_impl.cPeter Zhu
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.