MCPcopy Create free account
hub / github.com/beefytech/Beef / alignedNewImpl

Function alignedNewImpl

BeefRT/JEMalloc/src/jemalloc_cpp.cpp:135–144  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

133
134template <bool IsNoExcept>
135JEMALLOC_ALWAYS_INLINE
136void *
137alignedNewImpl(std::size_t size, std::align_val_t alignment) noexcept(IsNoExcept) {
138 void *ptr = je_aligned_alloc(static_cast<std::size_t>(alignment), size);
139 if (likely(ptr != nullptr)) {
140 return ptr;
141 }
142
143 return handleOOM(size, IsNoExcept);
144}
145
146void *
147operator new(std::size_t size, std::align_val_t alignment) {

Callers

nothing calls this directly

Calls 1

handleOOMFunction · 0.85

Tested by

no test coverage detected