MCPcopy Create free account
hub / github.com/facebook/CacheLib / makeItem

Method makeItem

cachelib/interface/tests/InterfaceTest.cpp:264–276  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

262 public:
263 template <typename HandleT>
264 TestCacheItem* makeItem() {
265 auto* item = new TestCacheItem(key_,
266 /* valueSize */ 128,
267 /* creationTime */ 1000,
268 /* ttlSecs */ 10);
269 std::memcpy(item->getMemory(), data_, sizeof(data_));
270 if constexpr (std::is_same_v<HandleT, AllocatedHandle>) {
271 cache_.allocatedItems_.emplace_back(item);
272 } else {
273 cache_.cachedItems_.try_emplace(key_, item);
274 }
275 return item;
276 }
277
278 template <typename HandleT>
279 void checkReleased(TestCacheItem* item, bool removedFromCache = true) {

Callers

nothing calls this directly

Calls 1

getMemoryMethod · 0.45

Tested by

no test coverage detected