aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2025-07-08 16:33:21 +0200
committerGitHub <noreply@github.com>2025-07-08 16:33:21 +0200
commit454637403af8ce12949d6e6cc64ce6523433a8b9 (patch)
tree0e506498d5541d924338005c206ed47eabf8c605
parent0070322ef2275aaf822459119cf7b9c8b4e88364 (diff)
downloadlibuv-454637403af8ce12949d6e6cc64ce6523433a8b9.tar.gz
libuv-454637403af8ce12949d6e6cc64ce6523433a8b9.zip
win: replace inline asm with compiler intrinsic (#4829)
Switch to __sync_fetch_and_or on x86. Libuv already uses it on other architectures.
-rw-r--r--src/win/async.c11
1 files changed, 0 insertions, 11 deletions
diff --git a/src/win/async.c b/src/win/async.c
index 07ba4f68..4c2cd265 100644
--- a/src/win/async.c
+++ b/src/win/async.c
@@ -41,18 +41,7 @@ static char uv__atomic_exchange_set(char volatile* target) {
#else /* GCC, Clang in mingw mode */
static char uv__atomic_exchange_set(char volatile* target) {
-#if defined(__i386__) || defined(__x86_64__)
- /* Mingw-32 version, hopefully this works for 64-bit gcc as well. */
- const char one = 1;
- char old_value;
- __asm__ __volatile__ ("lock xchgb %0, %1\n\t"
- : "=r"(old_value), "=m"(*target)
- : "0"(one), "m"(*target)
- : "memory");
- return old_value;
-#else
return __sync_fetch_and_or(target, 1);
-#endif
}
#endif /* _MSC_VER */