snapshot (Borges::StateRegistry)

    # File lib/Borges/Utilities/StateRegistry.rb, line 86
      def snapshot
        gc_disabled = nil
        snapshot = {}

        Thread.exclusive do
          gc_disabled = GC.disable
        end

        @wrefs.each do |wref|
          if wref.weakref_alive? then
            obj = wref.__getobj__
            snapshot[obj] = obj.clone
          end
        end

        GC.enable unless gc_disabled

        @wrefs.delete_if do |wref|
          not wref.weakref_alive?
        end

        return snapshot
      end