Sha256: 0c1d5b45e16434b4d10eaf8350e88fd502cd2954546d514656f9a13203034d9d

Contents?: true

Size: 763 Bytes

Versions: 7

Compression:

Stored size: 763 Bytes

Contents

class Remnant
  class GC
    module ClassMethods
      def enabled?
        _gc.enabled?
      end

      def enable_stats
        _gc.enable_stats
      end

      def disable_stats
        _gc.disable_stats
      end

      def clear_stats
        _gc.clear_stats
      end

      def time
        _gc.time
      end

      def collections
        _gc.collections
      end

      def _gc
        Thread.current['remnant.gc'] ||= _gc_implementation
      end

      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
    end
    extend ClassMethods
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
remnant-1.0.0 lib/remnant/gc.rb
remnant-0.9.5 lib/remnant/gc.rb
remnant-0.9.4 lib/remnant/gc.rb
remnant-0.9.3 lib/remnant/gc.rb
remnant-0.9.2 lib/remnant/gc.rb
remnant-0.9.1 lib/remnant/gc.rb
remnant-0.9.0 lib/remnant/gc.rb