bluele / gcache

An in-memory cache library for golang. It supports multiple eviction policies: LRU, LFU, ARC
MIT License
2.6k stars 271 forks source link

fix bug:length of evictList maybe bigger more than c.size #56

Closed sbraveyoung closed 5 years ago

sbraveyoung commented 5 years ago

If a bug occurs in other place, that cause the length of evictList is bigger than c.size+1, after this code c.evict(1), the cache is still full。

bluele commented 5 years ago

If a bug occurs in other place,

I think that we should fix such a bug instead of this workaround.