MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / _aligned_malloc

Function _aligned_malloc

common/AlignedMalloc.cpp:15–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13#include <cstdlib>
14
15void* _aligned_malloc(size_t size, size_t align)
16{
17 pxAssert(align < 0x10000);
18#if defined(__USE_ISOC11) && !defined(ASAN_WORKAROUND) // not supported yet on gcc 4.9
19 return aligned_alloc(align, size);
20#else
21#ifdef __APPLE__
22 // MacOS has a bug where posix_memalign is ridiculously slow on unaligned sizes
23 // This especially bad on M1s for some reason
24 size = (size + align - 1) & ~(align - 1);
25#endif
26 void* result = 0;
27 posix_memalign(&result, align, size);
28 return result;
29#endif
30}
31
32void* pcsx2_aligned_realloc(void* handle, size_t new_size, size_t align, size_t old_size)
33{

Callers 15

DefaultAllocateFunction · 0.85
AlignedMallocFunction · 0.85
winmm_buffer_callbackFunction · 0.85
winmm_initFunction · 0.85
vma_aligned_allocFunction · 0.85
vma_aligned_allocFunction · 0.85
iopMemAllocFunction · 0.85
resetMethod · 0.85
InitMethod · 0.85
addMethod · 0.85
microVU.cppFile · 0.85
OpenMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected