summaryrefslogtreecommitdiff
path: root/gc
AgeCommit message (Collapse)Author
2025-03-25Prefer FL_TEST_RAW() in GC on known on-heap objectsAlan Wu
Was reading some assembly and noticed the dead branches generated for FL_TEST(). Just a quick basic pass to change the obvious places; there may be other opportunities. Notes: Merged: https://github.com/ruby/ruby/pull/12980 Merged-By: XrXr
2025-03-25Make ruby_autocompact_compare_func staticPeter Zhu
It's not used outside of default.c. Notes: Merged: https://github.com/ruby/ruby/pull/12964
2025-03-25Make ruby_enable_autocompact staticPeter Zhu
It's not used outside of defaut.c Notes: Merged: https://github.com/ruby/ruby/pull/12964
2025-03-25[DOC] Use install-modular-gc in gc/README.mdPeter Zhu
Notes: Merged: https://github.com/ruby/ruby/pull/12976
2025-03-24Move rb_gc_impl_ractor_cache_free to shutdown sectionPeter Zhu
Notes: Merged: https://github.com/ruby/ruby/pull/12965
2025-03-24Move rb_gc_impl_objspace_free to shutdown sectionPeter Zhu
Notes: Merged: https://github.com/ruby/ruby/pull/12965
2025-03-13Output object_id in object metadata for MMTkPeter Zhu
Notes: Merged: https://github.com/ruby/ruby/pull/12915
2025-03-13Move object_id to flags for ObjectSpace dumpsPeter Zhu
Moving object_id dumping from ObjectSpace to the GC flags allows ObjectSpace to not assume the FL_SEEN_OBJ_ID flag and instead move it to the responsibility of the GC. Notes: Merged: https://github.com/ruby/ruby/pull/12915
2025-02-24[ruby/mmtk] Trigger forced GC in GC.startKunshan Wang
We now use `MMTK::handle_user_collection_request(true, ...)` to force triggering a GC instead of enabling GC temporarily. https://github.com/ruby/mmtk/commit/02ef47f818
2025-02-20[ruby/mmtk] Fix compatibility for Rust 1.85Peter Zhu
https://github.com/ruby/mmtk/commit/9da566e26a
2025-02-19Fix value of RB_GC_OBJECT_METADATA_ENTRY_COUNTPeter Zhu
There are 7 entries in RB_GC_OBJECT_METADATA_ENTRY_COUNT.
2025-02-19Add age to rb_gc_object_metadataPeter Zhu
This will allow ObjectSpace.dump to output the age of the object. Notes: Merged: https://github.com/ruby/ruby/pull/12777
2025-02-19Implement rb_gc_object_metadata for MMTkPeter Zhu
Notes: Merged: https://github.com/ruby/ruby/pull/12777
2025-02-19Add rb_gc_object_metadata APIPeter Zhu
This function replaces the internal rb_obj_gc_flags API. rb_gc_object_metadata returns an array of name and value pairs, with the last element having 0 for the name. Notes: Merged: https://github.com/ruby/ruby/pull/12777
2025-02-19[wasm] Stop using mprotect(PROT_NONE) on WASIYuta Saito
we had been using a stub weak definition of `mprotect` in wasm/missing.c so far, but wasi-sdk 23 added mprotect emulation to wasi-libc[^1], so the emulation is now linked instead. However, the emulation doesn't support PROT_NONE and fails with ENOSYS, so we need to avoid calling mprotect completely on WASI. [^1]: https://github.com/WebAssembly/wasi-libc/commit/7528b13170462c82e367d91ae0ecead84e470ceb Notes: Merged: https://github.com/ruby/ruby/pull/12776
2025-02-10[ruby/mmtk] Set Immix as the default planPeter Zhu
https://github.com/ruby/mmtk/commit/e52b973611
2025-02-10gc.c: Remove no-op codeDaisuke Aritomo
In this context, `vm_locked` is a argument variable, and is not used later in the function. Notes: Merged: https://github.com/ruby/ruby/pull/12718
2025-01-29Use an identity hash instead of array for stress_to_classPeter Zhu
Notes: Merged: https://github.com/ruby/ruby/pull/12664
2025-01-29Fix GC.add_stress_to_class and GC.remove_stress_to_classPeter Zhu
These methods were accidentally removed in [Feature #20470]. This commit adds them back. Notes: Merged: https://github.com/ruby/ruby/pull/12664
2025-01-29Suppress unused-value warningsNobuyoshi Nakada
2025-01-27Fix gc_update_references_weak_table_i for ASANPeter Zhu
If the object is a T_MOVED, then it is poisoned in ASAN, so we need to unpoison it before checking the type. Notes: Merged: https://github.com/ruby/ruby/pull/12644
2025-01-27Fix rb_gc_vm_weak_table_foreach compatibility for MMTKPeter Zhu
Notes: Merged: https://github.com/ruby/ruby/pull/12629
2025-01-27Use rb_gc_vm_weak_table_foreach for reference updatingPeter Zhu
We can use rb_gc_vm_weak_table_foreach for reference updating of weak tables in the default GC. Notes: Merged: https://github.com/ruby/ruby/pull/12629
2025-01-27Optionally traverse non-weak references in rb_gc_vm_weak_table_foreachPeter Zhu
For moving garbage collectors, we may want to combine liveliness checking with reference updating for performance. This commit allows for non-weak references to be passed into the callback function when weak_only is false. Notes: Merged: https://github.com/ruby/ruby/pull/12629
2025-01-22[ruby/mmtk] Remove unused lazy_static dependencyPeter Zhu
https://github.com/ruby/mmtk/commit/f47a1e2d17
2025-01-22Add generic ivar reference updating stepPeter Zhu
Previously, generic ivars worked differently than the other global tables during compaction. The other global tables had their references updated through iteration during rb_gc_update_vm_references. Generic ivars updated the keys when the object moved and updated the values while reference updating the object. This is inefficient as this required one lookup for every moved object and one lookup for every object with generic ivars. Instead, this commit changes it to iterate over the generic ivar table to update both the keys and values. Notes: Merged: https://github.com/ruby/ruby/pull/12607
2025-01-21[ruby/mmtk] Bump mmtk-corePeter Zhu
Fixes a bug where there is an infinite loop when MMTK_HEAP_MIN is small. https://github.com/ruby/mmtk/commit/12c7ede20b
2025-01-17[ruby/mmtk] Add mmtk_heap_max to GC.configPeter Zhu
https://github.com/ruby/mmtk/commit/6a78ffaf16
2025-01-16[ruby/mmtk] Add mmtk_heap_min to GC.configPeter Zhu
https://github.com/ruby/mmtk/commit/5bbac70c69
2025-01-16[ruby/mmtk] Bump mmtk-corePeter Zhu
https://github.com/ruby/mmtk/commit/52b857ea04
2025-01-16[ruby/mmtk] Add mmtk_heap_mode to GC.configPeter Zhu
https://github.com/ruby/mmtk/commit/810f897603
2025-01-15[ruby/mmtk] Add mmtk_plan to GC.configPeter Zhu
https://github.com/ruby/mmtk/commit/67da9ea5b8
2025-01-15[ruby/mmtk] Fix mmtk.hPeter Zhu
https://github.com/ruby/mmtk/commit/dbb4036be9
2025-01-15[ruby/mmtk] Bump mmtk-corePeter Zhu
https://github.com/mmtk/mmtk-core/pull/1261 fixes an issue where the following script causes a Rust panic: GC.disable 10_000.times { Object.new } puts GC.stat https://github.com/ruby/mmtk/commit/6191ee994a
2025-01-14[ruby/mmtk] Add mmtk_worker_count to GC.configPeter Zhu
https://github.com/ruby/mmtk/commit/836a9059cb
2025-01-14[ruby/mmtk] Exit with error message if MMTK_PLAN is invalidPeter Zhu
https://github.com/ruby/mmtk/commit/79ce2008a3
2025-01-14[ruby/mmtk] Exit with error message if MMTK_HEAP_MODE is invalidPeter Zhu
https://github.com/ruby/mmtk/commit/c8b1f4c156
2025-01-14Simplify gc/mmtk/extconf.rbNobuyoshi Nakada
- Split static recipes to depend file. - Modify makefile configurations in the block to `create_makefile`. - Expand rust sources in extconf.rb instead of GNU make extension. TODO: pass `CARGO_TARGET_DIR` without shell syntax. Notes: Merged: https://github.com/ruby/ruby/pull/12572
2025-01-13[ruby/mmtk] Exit with error message if MMTK_HEAP_MAX is invalidPeter Zhu
https://github.com/ruby/mmtk/commit/4a24d55d91
2025-01-13[ruby/mmtk] Exit with error message if MMTK_HEAP_MIN is invalidPeter Zhu
https://github.com/ruby/mmtk/commit/1d2f7b9cfc
2025-01-13[ruby/mmtk] Exit with error message if MMTK_THREADS is invalidPeter Zhu
https://github.com/ruby/mmtk/commit/5c5c454f65
2025-01-13[ruby/mmtk] Enable immix_non_moving featurePeter Zhu
https://github.com/ruby/mmtk/commit/63ab563e04
2025-01-09[ruby/mmtk] Enable UNIQUE_OBJECT_ENQUEUING in MMTkPeter Zhu
UNIQUE_OBJECT_ENQUEUING guarantees that object marking is atomic so that an object cannot be marked more than once. https://github.com/ruby/mmtk/commit/2f97fd8207
2025-01-09[ruby/mmtk] Bump mmtk-core toPeter Zhu
https://github.com/ruby/mmtk/commit/68bf1b638263 https://github.com/ruby/mmtk/commit/ba1ec69bf6
2025-01-09[ruby/mmtk] Fix libmmtk_ruby.a building in extconf.rbPeter Zhu
Since libmmtk_ruby.a was a PHONY target, it caused the shared object to not be rebuilt even though libmmtk_ruby.a was updated. https://github.com/ruby/mmtk/commit/076f0a97a6
2025-01-07[ruby/mmtk] Remove unused Ruby SHA reference in Cargo.tomlPeter Zhu
https://github.com/ruby/mmtk/commit/02b9439ea6
2025-01-07[ruby/mmtk] Bump mmtk-core versionPeter Zhu
https://github.com/ruby/mmtk/commit/0de72c03ba
2025-01-05gc/default/default.c: don't call `malloc_usable_size` when hint is presentJean Boussier
Depending on the allocator, `malloc_usable_size` may be very cheap or quite expensive. On `macOS` for instance, it's about as expensive as `malloc`. In many case we call `objspace_malloc_size` with as size we initially requested as `hint`. The real usable size may be a few bytes bigger, but since we only use that data to feed GC heuristics, I don't think it's very important to be perfectly accurate. It would make sense to call `malloc_usable_size` after growing a String or Array to use the extra capacity, but here we don't do that, so the call isn't worth its cost. Notes: Merged: https://github.com/ruby/ruby/pull/12490
2025-01-02Use rb_darray_insert_without_gc for heap_pages darrayPeter Zhu
rb_darray_insert could trigger a GC, which would cause problems if it freed pages while a new page was being inserted. For example, the following script fails: GC.stress = true GC.auto_compact = :empty 10.times do GC.verify_compaction_references(expand_heap: true, toward: :empty) end It errors out with: 'GC.verify_compaction_references': malloc: possible integer overflow (8*18446744073709551603) (ArgumentError) Notes: Merged: https://github.com/ruby/ruby/pull/12459
2025-01-02Revert "Remove with_gc functions in darray"Peter Zhu
This reverts commit 24a740796050b72aa2d35339ba2a317d4eda7b75. Notes: Merged: https://github.com/ruby/ruby/pull/12459