mjansson / rpmalloc

Public domain cross platform lock free thread caching 16-byte aligned memory allocator implemented in C
Other
2.16k stars 187 forks source link

Add ARM64 support on Windows #324

Closed Jasper-Bekkers closed 7 months ago

Jasper-Bekkers commented 9 months ago

I didn't do a thorough check but this seems to work for my use cases. It's a simple enough change where I just call the __yield intrinsic instead of _mm_pause which was leading to compilation problems.

Wodann commented 8 months ago

Apart from the ARM64 build, this also affects the i686 build for Windows.

Jasper-Bekkers commented 7 months ago

Apart from the ARM64 build, this also affects the i686 build for Windows.

Does that support _mm_pause? If that's the case we can just add the define for i686 as well to that branch.

mjansson commented 7 months ago

I think the MSVC preprocessor to check is _M_ARM64, so

#if defined(_M_ARM64)
    __yield();
#else 
    _mm_pause();
#endif
mjansson commented 7 months ago

I went ahead and committed the modified version I suggested, let me know if it works for you