core/gc.rbs in rbs-3.0.0.dev.2 vs core/gc.rbs in rbs-3.0.0.dev.3
- old
+ new
@@ -80,10 +80,12 @@
# The hash includes information about internal statistics about GC such as:
#
# count
# : The total number of garbage collections ran since application start (count
# includes both minor and major garbage collections)
+ # time
+ # : The total time spent in garbage collections (in milliseconds)
# heap_allocated_pages
# : The total number of `:heap_eden_pages` + `:heap_tomb_pages`
# heap_sorted_length
# : The number of pages that can fit into the buffer that holds references to
# all pages
@@ -118,10 +120,16 @@
# : When `:malloc_increase_bytes` crosses this limit, GC is triggered
# minor_gc_count
# : The total number of minor garbage collections run since process start
# major_gc_count
# : The total number of major garbage collections run since process start
+ # compact_count
+ # : The total number of compactions run since process start
+ # read_barrier_faults
+ # : The total number of times the read barrier was triggered during compaction
+ # total_moved_objects
+ # : The total number of objects compaction has moved
# remembered_wb_unprotected_objects
# : The total number of objects without write barriers
# remembered_wb_unprotected_objects_limit
# : When `:remembered_wb_unprotected_objects` crosses this limit, major GC is
# triggered
@@ -178,11 +186,11 @@
# Return measured GC total time in nano seconds.
#
def self.total_time: () -> Integer
# <!--
- # rdoc-file=gc.rb
+ # rdoc-file=gc.c
# - GC.compact
# -->
# This function compacts objects together in Ruby's heap. It eliminates unused
# space (or fragmentation) in the heap by moving objects in to that unused
# space. This function returns a hash which contains statistics about which
@@ -190,10 +198,14 @@
# statistics.
#
# This method is implementation specific and not expected to be implemented in
# any implementation besides MRI.
#
+ # To test whether GC compaction is supported, use the idiom:
+ #
+ # GC.respond_to?(:compact)
+ #
def self.compact: () -> ::Hash[:considered | :moved, Hash[Symbol | Integer, Integer]]
# <!--
# rdoc-file=gc.rb
# - GC.verify_compaction_references(toward: nil, double_heap: false) -> hash
@@ -202,11 +214,11 @@
#
# This method is implementation specific. During compaction, objects that were
# moved are replaced with T_MOVED objects. No object should have a reference to
# a T_MOVED object after compaction.
#
- # This function doubles the heap to ensure room to move all objects, compacts
+ # This function expands the heap to ensure room to move all objects, compacts
# the heap to make sure everything moves, updates all references, then performs
# a full GC. If any object contains a reference to a T_MOVED object, that
# object should be pushed on the mark stack, and will make a SEGV.
#
def self.verify_compaction_references: () -> ::Hash[:considered | :moved, Hash[Symbol | Integer, Integer]]
@@ -229,10 +241,10 @@
#
def self.verify_transient_heap_internal_consistency: () -> nil
# <!--
# rdoc-file=gc.rb
- # - GC.latest_gc_info -> {:gc_by=>:newobj}
+ # - GC.latest_gc_info -> hash
# - GC.latest_gc_info(hash) -> hash
# - GC.latest_gc_info(:major_by) -> :malloc
# -->
# Returns information about the most recent garbage collection.
#