fix: cache bucket crash if memory limit is defined

This commit is contained in:
Dmitry Kolesnikov 2013-11-21 15:53:43 +02:00
parent ceebafa2ba
commit b3382c75db
2 changed files with 3 additions and 3 deletions

View File

@ -1,7 +1,7 @@
{application, cache,
[
{description, "in-memory cache"},
{vsn, "0.9.0"},
{vsn, "0.9.1"},
{modules, [
cache,
cache_bucket,

View File

@ -76,7 +76,7 @@ init([{policy, X} | T], #cache{}=S) ->
init(T, S#cache{policy=X});
init([{memory, X} | Opts], S) ->
init(Opts, S#cache{memory=X div erlang:sysinfo(wordsize)});
init(Opts, S#cache{memory=X div erlang:system_info(wordsize)});
init([{size, X} | Opts], S) ->
init(Opts, S#cache{cardinality=X});