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

Function thread_alloc

include/iocore/eventsystem/ProxyAllocator.h:53–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51
52template <class CAlloc, typename... Args>
53typename CAlloc::Value_type *
54thread_alloc(CAlloc &a, ProxyAllocator &l, Args &&...args)
55{
56 if (!cmd_disable_pfreelist && l.freelist) {
57 void *v = l.freelist;
58 l.freelist = *reinterpret_cast<void **>(l.freelist);
59 --(l.allocated);
60#if TS_USE_ALLOCATOR_METRICS
61 a.increment_for_alloc();
62#endif
63 ::new (v) typename CAlloc::Value_type(std::forward<Args>(args)...);
64 return static_cast<typename CAlloc::Value_type *>(v);
65 }
66 return a.alloc(std::forward<Args>(args)...);
67}
68
69void *thread_alloc(Allocator &a, ProxyAllocator &l);
70

Callers

nothing calls this directly

Calls 2

increment_for_allocMethod · 0.80
allocMethod · 0.45

Tested by

no test coverage detected