MCPcopy Create free account
hub / github.com/apache/trafficserver / free

Method free

src/iocore/hostdb/P_RefCountCache.h:104–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

102
103 template <typename C>
104 static void
105 free(RefCountCacheHashEntry *e)
106 {
107 // Since the Value is actually RefCountObj-- when this gets deleted normally it calls the wrong
108 // `free` method, this forces the delete/decr to happen with the right type
109 Ptr<C> *tmp = reinterpret_cast<Ptr<C> *>(&e->item);
110 tmp->clear();
111
112 e->~RefCountCacheHashEntry();
113 dealloc(e);
114 }
115};
116
117// Since the hashing values are all fixed size, we can simply use a classAllocator to avoid mallocs

Callers 1

dealloc_entryMethod · 0.45

Calls 1

clearMethod · 0.45

Tested by

no test coverage detected