mirror of https://github.com/PCSX2/pcsx2.git
Common: Fix slow emulator startup on M1s
This commit is contained in:
parent
50f90aee79
commit
ee451fe345
|
@ -28,6 +28,11 @@ void* _aligned_malloc(size_t size, size_t align)
|
||||||
#if defined(__USE_ISOC11) && !defined(ASAN_WORKAROUND) // not supported yet on gcc 4.9
|
#if defined(__USE_ISOC11) && !defined(ASAN_WORKAROUND) // not supported yet on gcc 4.9
|
||||||
return aligned_alloc(align, size);
|
return aligned_alloc(align, size);
|
||||||
#else
|
#else
|
||||||
|
#ifdef __APPLE__
|
||||||
|
// MacOS has a bug where posix_memalign is ridiculously slow on unaligned sizes
|
||||||
|
// This especially bad on M1s for some reason
|
||||||
|
size = (size + align - 1) & ~(align - 1);
|
||||||
|
#endif
|
||||||
void* result = 0;
|
void* result = 0;
|
||||||
posix_memalign(&result, align, size);
|
posix_memalign(&result, align, size);
|
||||||
return result;
|
return result;
|
||||||
|
|
Loading…
Reference in New Issue