dgraph-io / ristretto

A high performance memory-bound Go cache
https://dgraph.io/blog/post/introducing-ristretto-high-perf-go-cache/
Apache License 2.0
5.54k stars 364 forks source link

Cache configuration checks should consider negative values for `NumCounters`/`MaxCost`/`BufferItems` #378

Open ankon opened 5 months ago

ankon commented 5 months ago

Found while reading through the code: https://github.com/dgraph-io/ristretto/blob/c67e07994f911dbf42104f568c83a29830e88236/cache.go#L169-L174

The checks are fine, but given that these are int64s they could be <0 which the checks won't catch unless I'm missing something.

github-actions[bot] commented 2 months ago

This issue has been stale for 60 days and will be closed automatically in 7 days. Comment to keep it open.