Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →
class method
GC.enable
() -> bool
GC.enable → true or false
gc.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.4.1/gc.rb, line 54
def self.enable
Primitive.gc_enable
end
Enables garbage collection, returning true if garbage collection was previously disabled.
Example
GC.disable #=> false GC.enable #=> true GC.enable #=> false
See also
.disable
.latest_gc_info
.count
.measure_total_time
also in
4.1 · 4.0 · 3.3 · 3.2 · 3.1 · 3.0