Align cache with default

Stop L0 from growing too large i.e. 127 * 4K is more than 10 times bigger than the default.
This commit is contained in:
Martin Sumner 2019-02-25 23:35:12 +00:00
parent aea20de4b9
commit fd2e0e870c
3 changed files with 12 additions and 18 deletions

View file

@ -44,6 +44,8 @@
-include_lib("eunit/include/eunit.hrl").
-define(MAX_CACHE_LINES, 31). % Must be less than 128
% -type index_array() :: array:array().
-type index_array() :: any()|none. % To live with OTP16
@ -55,9 +57,9 @@
-spec cache_full(list()) -> boolean().
%% @doc
%% If there are already 127 entries in the cache then the cache is full
%% If there are already 31 entries in the cache then the cache is full
cache_full(L0Cache) ->
length(L0Cache) == 127.
length(L0Cache) == ?MAX_CACHE_LINES.
-spec prepare_for_index(index_array(), leveled_codec:segment_hash())
-> index_array().