From ba9b001dd367a0b31bce49cd90d74f0cd5a587b0 Mon Sep 17 00:00:00 2001 From: Mattias Jansson Date: Mon, 1 Apr 2024 09:04:17 +0200 Subject: [PATCH] Use __yield on ARM64 Windows --- rpmalloc/rpmalloc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rpmalloc/rpmalloc.c b/rpmalloc/rpmalloc.c index e82bca2..33d468f 100644 --- a/rpmalloc/rpmalloc.c +++ b/rpmalloc/rpmalloc.c @@ -841,7 +841,11 @@ rpmalloc_set_main_thread(void) { static void _rpmalloc_spin(void) { #if defined(_MSC_VER) +#if defined(_M_ARM64) + __yield(); +#else _mm_pause(); +#endif #elif defined(__x86_64__) || defined(__i386__) __asm__ volatile("pause" ::: "memory"); #elif defined(__aarch64__) || (defined(__arm__) && __ARM_ARCH >= 7)