MCPcopy Create free account
hub / github.com/OpenPathGuidingLibrary/openpgl / alignedMalloc

Function alignedMalloc

openpgl/openpgl_common.h:221–233  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

219{
220
221inline void *alignedMalloc(size_t size, size_t align)
222{
223 if (size == 0)
224 return nullptr;
225
226 assert((align & (align - 1)) == 0);
227 void *ptr = _mm_malloc(size, align);
228
229 if (size != 0 && ptr == nullptr)
230 throw std::bad_alloc();
231
232 return ptr;
233}
234
235inline void alignedFree(void *ptr)
236{

Callers 3

buildRegionSearchTreeMethod · 0.50
buildRegionNeighboursMethod · 0.50
deserializeMethod · 0.50

Calls 1

_mm_mallocFunction · 0.85

Tested by

no test coverage detected