On Thu, Jan 27, 2011 at 2:11 PM, Filipe David Manana <[email protected]> wrote: > On Thu, Jan 27, 2011 at 1:07 PM, Benoit Chesneau <[email protected]> wrote: >> >> However I'm not sure that if someone set a new size > cache_size then >> Count is < 0 and will create an error. I will put the guard on top and >> match (_) for that. > > handle_call({new_max_cache_size, NewSize}, > _From, #state{cache_size = Size} = State) when NewSize >= Size -> > {reply, ok, State#state{max_cache_size = NewSize}}; > > handle_call({new_max_cache_size, NewSize}, _From, State) -> > free_mru_cache_entries(State#state.cache_size - NewSize), > {reply, ok, State#state{max_cache_size = NewSize, cache_size = NewSize}}; > > Please read the surrounding code :) >
I missed that, my bad :) Sorry for that. - benoît
