MCPcopy Index your code
hub / github.com/facebook/CacheLib / ObjectCacheDestructorData

Class ObjectCacheDestructorData

cachelib/object_cache/ObjectCache.h:60–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58};
59
60struct ObjectCacheDestructorData {
61 ObjectCacheDestructorData(ObjectCacheDestructorContext ctx,
62 uintptr_t ptr,
63 const KAllocation::Key& k,
64 uint32_t expiryTime,
65 uint32_t creationTime,
66 uint32_t lastAccessTime)
67 : context(ctx),
68 objectPtr(ptr),
69 key(k),
70 expiryTime(expiryTime),
71 creationTime(creationTime),
72 lastAccessTime(lastAccessTime) {}
73
74 // release the evicted/removed/expired object memory
75 template <typename T>
76 void deleteObject() {
77 delete reinterpret_cast<T*>(objectPtr);
78 }
79
80 // remove or eviction
81 ObjectCacheDestructorContext context;
82
83 // pointer of the evicted/removed/expired object
84 uintptr_t objectPtr;
85
86 // the key corresponding to the evicted/removed/expired object
87 const KAllocation::Key& key;
88
89 // the expiry time of the object
90 uint32_t expiryTime;
91
92 // the creation time of the object
93 uint32_t creationTime;
94
95 // the last time this object was accessed
96 uint32_t lastAccessTime;
97};
98
99template <typename AllocatorT>
100class ObjectCache : public ObjectCacheBase<AllocatorT> {

Callers 1

initMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected