def delete_unmarked_objects
      # We don't update the index and the space list during this operation as
      # we defragmentize the blob file at the end. We'll end the operation
      # with an empty space list.
      clear_index_files

      deleted_objects_count = 0
      @progressmeter.start('Sweeping unmarked objects', @f.size) do |pm|
        each_blob_header do |header|
          if header.is_valid? && !@marks.include?(header.id)
            delete_obj_by_address(header.addr, header.id)
            deleted_objects_count += 1
          end

          pm.update(header.addr)
        end
      end
      defragmentize

      # Update the index file and create a new, empty space list.
      regenerate_index_and_spaces

      deleted_objects_count
    end
def delete_unmarked_objects
      # We don't update the index and the space list during this operation as
      # we defragmentize the blob file at the end. We'll end the operation
      # with an empty space list.
      clear_index_files

      deleted_objects_count = 0
      @progressmeter.start('Sweeping unmarked objects', @f.size) do |pm|
        each_blob_header do |header|
          if header.is_valid? && !@marks.include?(header.id)
            delete_obj_by_address(header.addr, header.id)
            deleted_objects_count += 1
          end

          pm.update(header.addr)
        end
      end
      defragmentize

      # Update the index file and create a new, empty space list.
      regenerate_index_and_spaces

      deleted_objects_count
    end
Delete all unmarked objects.