summaryrefslogtreecommitdiff
path: root/gc
AgeCommit message (Collapse)Author
2025-02-20[ruby/mmtk] Fix compatibility for Rust 1.85Peter Zhu
https://github.com/ruby/mmtk/commit/9da566e26a
2024-12-19[DOC] Add gc/README.mdPeter Zhu
Notes: Merged: https://github.com/ruby/ruby/pull/12379
2024-12-19Prefix asan_poison_object with rbPeter Zhu
Notes: Merged: https://github.com/ruby/ruby/pull/12385
2024-12-19Fix compaction in ASAN with RGENGC_CHECK_MODE enabledPeter Zhu
Notes: Merged: https://github.com/ruby/ruby/pull/12385
2024-12-19Don't calculate the aligned slot when unlocking pagePeter Zhu
If we try to use GET_PAGE_HEADER, it can trigger the read barrier. If we try to align on the slot then we end up unlocking the heap page of a lower memory address. Notes: Merged: https://github.com/ruby/ruby/pull/12385
2024-12-19Don't unpoison a NULL objectPeter Zhu
Notes: Merged: https://github.com/ruby/ruby/pull/12385
2024-12-19Unpoison memory before accessing next element of freelistPeter Zhu
Notes: Merged: https://github.com/ruby/ruby/pull/12385
2024-12-16Move special constant check in rb_gc_location to gc.cPeter Zhu
Notes: Merged: https://github.com/ruby/ruby/pull/12359
2024-12-11Fix compilation with MALLOC_ALLOCATED_SIZEJohn Hawthorn
Previously compilation failed with -DMALLOC_ALLOCATED_SIZE=1 Co-authored-by: Matthew Draper <matthew@trebex.net> Notes: Merged: https://github.com/ruby/ruby/pull/12313
2024-12-11[Bug #20941] Bail out when recursing no memoryNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/12307
2024-12-09[ruby/mmtk] Also remove .rustc_info.json in clean-mmtk targetPeter Zhu
https://github.com/ruby/mmtk/commit/4b67c8b4da
2024-12-09[ruby/mmtk] Add target clean-mmtk to clean Rust debug and release directoriesPeter Zhu
https://github.com/ruby/mmtk/commit/1f71cb873c
2024-12-06Add rb_gc_impl_active_gc_name to gc/gc_impl.hPeter Zhu
Notes: Merged: https://github.com/ruby/ruby/pull/12271
2024-12-05Use rb_gc_enable/rb_gc_disable_no_rest instead of ruby_disable_gcPeter Zhu
We should use the rb_gc_enable/rb_gc_disable_no_rest APIs instead of directly setting the ruby_disable_gc variable. Notes: Merged: https://github.com/ruby/ruby/pull/12264
2024-12-05darray.h does not depend on internal/bits.hPeter Zhu
darray.h no longer depends on internal/bits.h, so we can remove it. Notes: Merged: https://github.com/ruby/ruby/pull/12270
2024-12-05[ruby/mmtk] Support setting the mmtk thread count with MMTK_THREADSMatt Valentine-House
https://github.com/ruby/mmtk/commit/e4d6b56824
2024-12-05Standardize on the name "modular GC"Peter Zhu
We have name fragmentation for this feature, including "shared GC", "modular GC", and "external GC". This commit standardizes the feature name to "modular GC" and the implementation to "GC library". Notes: Merged: https://github.com/ruby/ruby/pull/12261
2024-12-04Use BUILDING_SHARED_GC instead of RB_AMALGAMATED_DEFAULT_GCPeter Zhu
We can use the BUILDING_SHARED_GC flag to check if we're building gc_impl.h as a shared GC or building the default GC. Notes: Merged: https://github.com/ruby/ruby/pull/12243
2024-11-29rb_gc_impl_malloc can return NULL卜部昌平
Let there be rooms for each GC implementations how to handle multi threaded situations. They can be totally reentrant, or can have their own mutex, or can rely on rb_thread_call_with_gvl. In any ways the allocator (has been, but now officially is) expected to run properly without a GVL. This means there need be a way for them to inform the interpreter about their allocation failures, without relying on raising exceptions. Let them do so by returning NULL. Notes: Merged: https://github.com/ruby/ruby/pull/12188
2024-11-26Fix up gc/extconf_base.rbNobuyoshi Nakada
- Add flags to appropriate variables. - Use `append_cflags` to append a flag safely, instead of appending blindly. Notes: Merged: https://github.com/ruby/ruby/pull/12166
2024-11-25Place all non-default GC API behind USE_SHARED_GCMatt Valentine-House
So that it doesn't get included in the generated binaries for builds that don't support loading shared GC modules Co-Authored-By: Peter Zhu <peter@peterzhu.ca> Notes: Merged: https://github.com/ruby/ruby/pull/12149
2024-11-25Use extconf to build external GC modulesMatt Valentine-House
Co-Authored-By: Peter Zhu <peter@peterzhu.ca> Notes: Merged: https://github.com/ruby/ruby/pull/12149
2024-11-24Fix a build failure with muslEarlopain
``` compiling gc.c In file included from gc.c:80: /usr/include/sys/prctl.h:88:8: error: redefinition of 'struct prctl_mm_map' 88 | struct prctl_mm_map { | ^~~~~~~~~~~~ In file included from gc.c:79: /usr/include/linux/prctl.h:134:8: note: originally defined here 134 | struct prctl_mm_map { | ^~~~~~~~~~~~ ``` The first include is not needed and is what causes this issue. Two other places in ruby exclusively use the sys import. See https://github.com/seccomp/libseccomp/issues/19 for a similar problem. Notes: Merged: https://github.com/ruby/ruby/pull/12154
2024-11-22[ruby/mmtk] Use extconf.rb for external GC compilationPeter Zhu
This commit adds extconf.rb for both the default GC and and MMTk to build the external GC. This allows common.mk to not need to contain any implementation-specific build configuration. https://github.com/ruby/mmtk/commit/db6a29b4a9
2024-11-22[ruby/mmtk] [Feature #20860] Implement Mark-Sweep with MMTKPeter Zhu
This commit implements the mark-sweep algorithm using MMTk and allows customizing the plan using MMTK_PLAN. https://github.com/ruby/mmtk/commit/6fea5e5ffc Co-Authored-By: Matt Valentine-House <matt@eightbitraptor.com>
2024-11-22[ruby/mmtk] [Feature #20860] Implement NoGC with MMTkPeter Zhu
This commit only supports initializing MMTk with NoGC and object allocation. https://github.com/ruby/mmtk/commit/39aa10e537 Co-Authored-By: Kunshan Wang <wks1986@gmail.com>
2024-11-21Annotate anonymous mmapKunshan Wang
Use PR_SET_VMA_ANON_NAME to set human-readable names for anonymous virtual memory areas mapped by `mmap()` when compiled and run on Linux 5.17 or higher. This makes it convenient for developers to debug mmap. Notes: Merged: https://github.com/ruby/ruby/pull/12119
2024-11-14Expose GC.config[:implementation], to query the currently active GCMatt Valentine-House
And a default and readonly key to the GC.config hash that names the current GC implementation. This is provided by each implementation by the API function rb_gc_impl_active_gc_name Notes: Merged: https://github.com/ruby/ruby/pull/11872
2024-11-05Remove RGENGC_FORCE_MAJOR_GC flagMatt Valentine-House
[Bug #20762] Notes: Merged: https://github.com/ruby/ruby/pull/12002
2024-10-31[DOC] Fix typoskojix2
Notes: Merged: https://github.com/ruby/ruby/pull/11967 Merged-By: nobu <nobu@ruby-lang.org>
2024-10-25Remove useless freelist unlock/lock in gc_ref_updatePeter Zhu
Notes: Merged: https://github.com/ruby/ruby/pull/11953
2024-10-23Move error handling for GC.stat_heap to gc.cPeter Zhu
Notes: Merged: https://github.com/ruby/ruby/pull/11932
2024-10-23Make rb_gc_impl_stat_heap return a VALUE instead of size_tPeter Zhu
Notes: Merged: https://github.com/ruby/ruby/pull/11932
2024-10-23Move error handling for GC.stat to gc.cPeter Zhu
Notes: Merged: https://github.com/ruby/ruby/pull/11932
2024-10-23Make rb_gc_impl_stat return a VALUE instead of size_tPeter Zhu
Notes: Merged: https://github.com/ruby/ruby/pull/11932
2024-10-23Move error handling for GC.latest_gc_info to gc.cPeter Zhu
Notes: Merged: https://github.com/ruby/ruby/pull/11932
2024-10-21Don't clear out flags in rb_gc_obj_freePeter Zhu
If there's a crash after rb_gc_obj_free, it's hard to debug because the flags have been cleared out already. Notes: Merged: https://github.com/ruby/ruby/pull/11925
2024-10-18Move object processing in Process.warmup to gc.cPeter Zhu
Notes: Merged: https://github.com/ruby/ruby/pull/11904
2024-10-10Move return value of rb_gc_impl_config_set to gc.cPeter Zhu
Notes: Merged: https://github.com/ruby/ruby/pull/11870
2024-10-10Directly call rb_gc_impl_writebarrier_unprotectPeter Zhu
Notes: Merged: https://github.com/ruby/ruby/pull/11857
2024-10-10Directly call rb_gc_impl_copy_finalizerPeter Zhu
Notes: Merged: https://github.com/ruby/ruby/pull/11857
2024-10-07Disable -Wunused-function for shared GC in gc/gc.hPeter Zhu
Shared GC might not use the private functions in gc/gc.h, so they will show up as warnings for unused functions. This commit disables -Wunused-function for these functions when building as shared GC. Notes: Merged: https://github.com/ruby/ruby/pull/11808
2024-10-03Rename size_pool -> heapMatt Valentine-House
Now that we've inlined the eden_heap into the size_pool, we should rename the size_pool to heap. So that Ruby contains multiple heaps, with different sized objects. The term heap as a collection of memory pages is more in memory management nomenclature, whereas size_pool was a name chosen out of necessity during the development of the Variable Width Allocation features of Ruby. The concept of size pools was introduced in order to facilitate different sized objects (other than the default 40 bytes). They wrapped the eden heap and the tomb heap, and some related state, and provided a reasonably simple way of duplicating all related concerns, to provide multiple pools that all shared the same structure but held different objects. Since then various changes have happend in Ruby's memory layout: * The concept of tomb heaps has been replaced by a global free pages list, with each page having it's slot size reconfigured at the point when it is resurrected * the eden heap has been inlined into the size pool itself, so that now the size pool directly controls the free_pages list, the sweeping page, the compaction cursor and the other state that was previously being managed by the eden heap. Now that there is no need for a heap wrapper, we should refer to the collection of pages containing Ruby objects as a heap again rather than a size pool Notes: Merged: https://github.com/ruby/ruby/pull/11771
2024-10-03Inline eden_heap into size_poolMatt Valentine-House
After the individual tomb_heaps were removed in favour of a global list of empty pages, the only instance of rb_heap_t left is the eden_heap within each size pool. This PR inlines the heap fields directly into rb_size_pool_t to remove indirection and remove the SIZE_POOL_EDEN_HEAP macro Notes: Merged: https://github.com/ruby/ruby/pull/11771
2024-10-03Remove unused macrosMatt Valentine-House
Notes: Merged: https://github.com/ruby/ruby/pull/11778
2024-10-02Fix compilation when RGENGC_CHECK_MODE >= 4Matt Valentine-House
the mark_function_data callback was moved from the ractor to the VM. Notes: Merged: https://github.com/ruby/ruby/pull/11770
2024-10-02Deduplicate RGENGC_CHECK_MODE into gc/gc.hPeter Zhu
Notes: Merged: https://github.com/ruby/ruby/pull/11764
2024-10-01Replace heap_eden_total_slots with objspace_available_slotsPeter Zhu
Notes: Merged: https://github.com/ruby/ruby/pull/11740
2024-09-30Move RUBY_INTERNAL_EVENT_FREEOBJ into GC implementationPeter Zhu
Instead of calling rb_gc_event_hook inside of rb_gc_obj_free, it should be up to the GC implementation to call the event. Notes: Merged: https://github.com/ruby/ruby/pull/11742
2024-09-30Remove unneeded prototype for objspace_available_slotsPeter Zhu
Notes: Merged: https://github.com/ruby/ruby/pull/11739