MCPcopy Create free account
hub / github.com/catboost/catboost / aligned_malloc

Function aligned_malloc

library/cpp/yt/malloc/malloc.cpp:27–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25#endif
26
27void* aligned_malloc(size_t size, size_t alignment)
28{
29#if defined(_win_)
30 return _aligned_malloc(size, alignment);
31#elif defined(_darwin_) || defined(_linux_) || defined(__FreeBSD__)
32 void* ptr = nullptr;
33 ::posix_memalign(&ptr, alignment, size);
34 return ptr;
35#else
36# error Unsupported platform
37#endif
38}
39
40////////////////////////////////////////////////////////////////////////////////

Callers 5

AllocateOrCrashFunction · 0.50
DoAllocateMethod · 0.50

Calls 2

_aligned_mallocFunction · 0.85
posix_memalignFunction · 0.50

Tested by

no test coverage detected