Module: Remnant::GC::ClassMethods
- Included in:
- Remnant::GC
- Defined in:
- lib/remnant/gc.rb
Instance Method Summary collapse
- #_gc ⇒ Object
- #_gc_implementation ⇒ Object
- #clear_stats ⇒ Object
- #collections ⇒ Object
- #disable_stats ⇒ Object
- #enable_stats ⇒ Object
- #enabled? ⇒ Boolean
- #time ⇒ Object
Instance Method Details
#_gc ⇒ Object
28 29 30 |
# File 'lib/remnant/gc.rb', line 28 def _gc Thread.current['remnant.gc'] ||= _gc_implementation end |
#_gc_implementation ⇒ Object
32 33 34 35 36 37 38 39 40 |
# File 'lib/remnant/gc.rb', line 32 def _gc_implementation if ::GC.respond_to?(:time) && ::GC.respond_to?(:collections) Remnant::GC::Ree elsif defined?(::GC::Profiler) Remnant::GC::Profiler else Remnant::GC::Base end end |
#clear_stats ⇒ Object
16 17 18 |
# File 'lib/remnant/gc.rb', line 16 def clear_stats _gc.clear_stats end |
#collections ⇒ Object
24 25 26 |
# File 'lib/remnant/gc.rb', line 24 def collections _gc.collections end |
#disable_stats ⇒ Object
12 13 14 |
# File 'lib/remnant/gc.rb', line 12 def disable_stats _gc.disable_stats end |
#enable_stats ⇒ Object
8 9 10 |
# File 'lib/remnant/gc.rb', line 8 def enable_stats _gc.enable_stats end |
#enabled? ⇒ Boolean
4 5 6 |
# File 'lib/remnant/gc.rb', line 4 def enabled? _gc.enabled? end |
#time ⇒ Object
20 21 22 |
# File 'lib/remnant/gc.rb', line 20 def time _gc.time end |