move EvictingCacheMap to folly
Summary:
adding @agartrell's implementation of EvictingCacheMap to folly. Its a general purpose
cache with LRU eviction. It maintains a doubly linked list threaded throught a hash map using
boost::intrusive. set, get and delete are all constant time operations. It is not thread safe.
Configurability: It allows callers to specify a hasher for the keys, has callbacks for eviction
events and the number of evictions on reaching a capacity limit is configurable. resizing for
a higher capacity though could be suboptimal since index is not resized accordingly and you could
end up with a bad load factor.
Test Plan: unit tests
Reviewed By: tulloch@fb.com, njormrod@fb.com
Subscribers: tulloch, chrisbray, mhx, doug, agartrell
FB internal diff:
D1483789