| 810 | // 'keys'. |
| 811 | template <typename SizeFunc, typename ProcessPin> |
| 812 | void makePins( |
| 813 | const std::vector<RawFileCacheKey>& keys, |
| 814 | SizeFunc sizeFunc, |
| 815 | ProcessPin processPin, |
| 816 | bool cacheable = true) { |
| 817 | for (auto i = 0; i < keys.size(); ++i) { |
| 818 | auto pin = findOrCreate(keys[i], sizeFunc(i), nullptr, cacheable); |
| 819 | if (pin.empty() || pin.checkedEntry()->isShared()) { |
| 820 | continue; |
| 821 | } |
| 822 | processPin(i, std::move(pin)); |
| 823 | } |
| 824 | } |
| 825 | |
| 826 | // Drops all unpinned entries. Pins stay valid. |
| 827 | void clear(); |