MCPcopy Create free account
hub / github.com/dmlc/dmlc-core / Create

Method Create

include/dmlc/memory.h:225–232  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

223 */
224 template <typename... Args>
225 inline static ThreadlocalSharedPtr<T> Create(Args&&... args) {
226 ThreadlocalAllocator<RefBlock> arena;
227 ThreadlocalSharedPtr<T> p;
228 p.block_ = arena.allocate(1);
229 p.block_->use_count_ = 1;
230 new (&(p.block_->data)) T(std::forward<Args>(args)...);
231 return p;
232 }
233
234 private:
235 // internal reference block

Callers

nothing calls this directly

Calls 1

allocateMethod · 0.45

Tested by

no test coverage detected