Add optional parameter pruneHook to EvictingCacheMap::set(..)
authorDmitry Panin <panin@fb.com>
Sat, 8 Nov 2014 01:31:02 +0000 (17:31 -0800)
committerDave Watson <davejwatson@fb.com>
Wed, 19 Nov 2014 20:52:09 +0000 (12:52 -0800)
commit0318bad6a53a78a0b358fba23a18cc29a7c233e8
tree87253b8cd9943412b22fff03b24c54b913c281fe
parent81e0e450f8304174c1ee4393c27e0dab79c8be71
Add optional parameter pruneHook to EvictingCacheMap::set(..)

Summary:
Inside `set()` we can do pruning, but it will happen
with default pruneHook.
Adding it as an optional param makes API more convenient.
(Instead, the users of API could just call `setPruneHook(pruneHook)` before `set`,
and then `setPruneHook(nullptr)` afterwards -- but it looks too ugly)

Test Plan:
```
fbconfig -r folly/ && fbmake runtests
```
passes:
```
Summary (total time 60.11s):
PASS: 1758
FAIL: 0
SKIP: 0
FATAL: 0
TIMEOUT: 0
```

Reviewed By: njormrod@fb.com

Subscribers: trunkagent, agartrell, njormrod, folly-diffs@

FB internal diff: D1665690

Tasks: 5551091

Signature: t1:1665690:1415391406:e4d2a956f9212aed70ab518159dbb19553764ce4
folly/EvictingCacheMap.h