Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →
class method
GC.disable
() -> bool
GC.disable → true or false
gc.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.4.1/gc.rb, line 66
def self.disable
Primitive.gc_disable
end
Disables garbage collection, returning true if garbage collection was already disabled.
Example
GC.disable #=> false GC.disable #=> true