MCPcopy Create free account
hub / github.com/GaijinEntertainment/daScript / das_aligned_alloc16

Function das_aligned_alloc16

include/daScript/misc/platform.h:448–464  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

446#ifndef DAS_ALIGNED_ALLOC
447#define DAS_ALIGNED_ALLOC 1
448inline void *das_aligned_alloc16(size_t size) {
449 DAS_ASSERTF(size != 0, "das_aligned_alloc16 called with size 0");
450 void *p;
451#if defined(_WIN32)
452 // All Windows toolchains (MSVC / clang-cl / clang-mingw64 / gcc-mingw64) use
453 // the MS C runtime aligned-allocator family declared in <malloc.h>.
454 p = _aligned_malloc(size, 16);
455#else
456 p = nullptr;
457 if (posix_memalign(&p, 16, size)) {
458 DAS_ASSERTF(0, "posix_memalign returned nullptr");
459 return nullptr;
460 }
461#endif
462 das::track_alloc_hook(p, size);
463 return p;
464}
465inline void das_aligned_free16(void *ptr) {
466 das::track_free_hook(ptr);
467#if defined(_WIN32)

Callers 15

StackAllocatorMethod · 0.85
tryOpenFileMethod · 0.85
introduceFileFromDiskMethod · 0.85
reuse_cache_allocateFunction · 0.85
reuse_cache_createFunction · 0.85
allocateMethod · 0.85
c_strMethod · 0.85
allocateMethod · 0.85
jit_alloc_persistentFunction · 0.85

Calls 1

track_alloc_hookFunction · 0.70

Tested by

no test coverage detected