anchor.diff:      end.
   
   %% @doc Insert an object into the memory backend.
  -%% NOTE: The memory backend does not currently
  -%% support secondary indexing and the _IndexSpecs
  -%% parameter is ignored.
   -type index_spec() :: {add, Index, SecondaryKey} | {remove, Index, SecondaryKey}.
   -spec put(riak_object:bucket(), riak_object:key(), [index_spec()], binary(), state()) ->
  -                 {ok, state()} |
  -                 {error, term(), state()}.
  +                 {ok, state()}.
   put(Bucket, PrimaryKey, IndexSpecs, Val, State=#state{data_ref=DataRef,
                                                         index_ref=IndexRef,
                                                         max_memory=MaxMemory,
  
positive.code:                  {ok, not_found, state()} |
                   {error, term(), state()}.
  get(Bucket, Key, State=#state{data_ref=DataRef,
                                ttl=TTL}) ->
      case ets:lookup(DataRef, {Bucket, Key}) of
          [] -> {error, not_found, State};
          [{{Bucket, Key}, {{ts, Timestamp}, Val}}] ->
              case exceeds_ttl(Timestamp, TTL) of
                  true ->
                      delete(Bucket, Key, undefined, State),
                      {error, not_found, State};
                  false ->
                      {ok, Val, State}
              end;
  
negative.code:         _ ->
              Val1 = {{ts, Now}, Val}
      end,
      {ok, Size} = do_put(Bucket, PrimaryKey, Val1, IndexSpecs, DataRef, IndexRef),
      case MaxMemory of
          undefined ->
              UsedMemory1 = UsedMemory;
          _ ->
              time_entry(Bucket, PrimaryKey, Now, TimeRef),
              Freed = trim_data_table(MaxMemory,
                                      UsedMemory + Size,
                                      DataRef,
                                      TimeRef,
                                      IndexRef,
                                      0),
              UsedMemory1 = UsedMemory + Size - Freed
      end,
      {ok, State#state{used_memory=UsedMemory1}}.
  
  %% @doc Delete an object from the memory backend
  -spec delete(riak_object:bucket(), riak_object:key(), [index_spec()], state()) ->
                      {ok, state()}.
  delete(Bucket, Key, IndexSpecs, State=#state{data_ref=DataRef,
  