Sha256: 8c8fc01766c50041411968f7a627211c8cd183981b20d0c9f2c979784ba57796

Contents?: true

Size: 641 Bytes

Versions: 1

Compression:

Stored size: 641 Bytes

Contents

class Remnant
  class GC
    module ClassMethods
      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
        else
          Remnant::GC::Base
        end
      end
    end
    extend ClassMethods
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
remnant-0.4.0 lib/remnant/gc.rb