anchor.diff:      end.
   
   
  -%% Perform the fold prepared by prep_fold.
  +%% Perform the fold step prepared by prep_fold.
   %% table
   fold(#state{status=spec_table, fold_fun=FoldFun, spec=Spec0} = State, RecL) ->
       Spec = lists:foldl(FoldFun, Spec0, RecL),
       State#state{spec=Spec};
   %% disk_log
  -fold(#state{status=spec_disk_log} = State, RecL) ->
  -    do_fold_disk_log(State, RecL).
  -
  -do_fold_disk_log(#state{status=spec_disk_log, fold_fun=FoldFun, spec=Spec0,
  -                        progress=Progress} = State, RecL) ->
  +fold(#state{status=spec_disk_log, fold_fun=FoldFun, spec=Spec0,
  +            progress=Progress} = State, RecL) ->
       case {ds_progress:get_count(Progress), RecL} of
           %% ignore log_header entry at the start
           {0, [{log_header, dcd_log, _, _, _, _}|RestRecL]} ->
  -            do_fold_disk_log(State, RestRecL);
  +            fold(State, RestRecL);
           _ ->
               Spec = lists:foldl(FoldFun, Spec0, RecL),
               State#state{spec=Spec}
       end.
   
  +%% Finish a fold and close resources opened by us.
  +%% Must be called by the same (master) process as the one that called init_fold.
   finish_fold(#state{status=spec_table, handle=Handle0} = State) ->
       Handle = close_dets_table(Handle0),
       State#state{status=idle, handle=Handle};
  
positive.code:             Progress = ds_progress:update(Progress0, Spec0, AccRecN),
              State1 = State0#state{current_pos=Pos0, limit=Limit0, progress=Progress},
              case prep_fold(State1) of
                  #state{status=idle} = State2 ->
                      ?debug("master: prep_fold -> idle", []),
                      NextPid ! get_result,
                      procs_master_loop(State2);
                  {#state{current_pos=NextPos, limit=Limit} = State2, RecL, RecN} ->
                      NextPid ! {proc, NextPos, Limit, RecN},
                      State = fold(State2, RecL),
  
negative.code:     {State#state{current_pos=NextF(Tab, Key), limit=counter_dec(Limit, RecN)}, RecL, RecN};
  %% disk_log
  prep_fold(#state{status=spec_disk_log, limit=0} = State) ->
      {State, done};
  prep_fold(#state{status=spec_disk_log, current_pos=Cont0, limit=Limit} = State) ->
      case disk_log:chunk(dlog, Cont0) of
          eof ->
  