def each
      @db.clear_marks
      # Start with the object 0 and the indexes of the root objects. Push them
      # onto the work stack.
      stack = [ 0 ] + @root_objects.values
      while !stack.empty?
        # Get an object index from the stack.
        id = stack.pop
        next if @db.is_marked?(id)

        unless (obj = object_by_id(id))
          PEROBS.log.fatal "Database is corrupted. Object with ID #{id} " +
            "not found."
        end
        # Mark the object so it will never be pushed to the stack again.
        @db.mark(id)
        yield(obj.myself) if block_given?
        # Push the IDs of all unmarked referenced objects onto the stack
        obj._referenced_object_ids.each do |r_id|
          stack << r_id unless @db.is_marked?(r_id)
        end
      end
    end
def each
      @db.clear_marks
      # Start with the object 0 and the indexes of the root objects. Push them
      # onto the work stack.
      stack = [ 0 ] + @root_objects.values
      while !stack.empty?
        # Get an object index from the stack.
        id = stack.pop
        next if @db.is_marked?(id)

        unless (obj = object_by_id(id))
          PEROBS.log.fatal "Database is corrupted. Object with ID #{id} " +
            "not found."
        end
        # Mark the object so it will never be pushed to the stack again.
        @db.mark(id)
        yield(obj.myself) if block_given?
        # Push the IDs of all unmarked referenced objects onto the stack
        obj._referenced_object_ids.each do |r_id|
          stack << r_id unless @db.is_marked?(r_id)
        end
      end
    end
Calls the given block once for each object, passing that object as a
 parameter.