anchor.diff:      {ok,#state{snapdir=SnapshotDir}}.
   
   handle_info(imem_snap_loop, #state{snapFun=SFun,snapHash=SHash} = State) ->
  -    ?Debug("snapshot loop"),
       case ?GET_SNAPSHOT_CYCLE_WAIT of
           MCW when (is_integer(MCW) andalso (MCW >= 100)) ->
               {SnapHash,SnapFun} = case {?GET_SNAPSHOT_SCRIPT, ?GET_SNAPSHOT_SCRIPT_FUN} of
                   {false, _} ->       {undefined,undefined};
                   {true, <<"">>} ->   {undefined,undefined};
                   {true, SFunStr} ->
  +                    ?Debug("snapshot fun ~p", [SFunStr]),
                       case erlang:phash2(SFunStr) of
                           SHash   -> {SHash,SFun};
                           H1      -> {H1,imem_meta:compile_fun(SFunStr)}
                       end
               end,
  -            ?Debug("snapshot snap hash ~p, snap fun ~p", [SnapHash, SnapFun]),
               do_snapshot(SnapFun),
               erlang:send_after(MCW, self(), imem_snap_loop),
               {noreply, State#state{snapFun=SnapFun,snapHash=SnapHash}};
  
positive.code:         , restore/5
          , zip/1
          , take/1
          ]).
  
  % gen_server callbacks
  
negative.code:     try  
          case SnapFun of
              undefined ->    ok;
              SnapFun -> 
                  ?Debug("snapshot..."),
                  ok = SnapFun()
          end,
          ok
      catch
  