]> gitweb.factorcode.org Git - factor.git/blobdiff - vm/atomic-cl-64.hpp
Put brackets around ipv6 addresses in `inet6 present`
[factor.git] / vm / atomic-cl-64.hpp
index 408a8fb29a0367ef9e4c99a5cf5d4922c0816300..3e99b851a37f2c9ef5a02de4c2db2ef9df5f0d6e 100644 (file)
@@ -1,49 +1,39 @@
 #define FACTOR_FORCE_INLINE __forceinline
 
 namespace factor {
-       namespace atomic {
-               __forceinline static bool cas(volatile cell *ptr, cell old_val, cell new_val)
-               {
-                       return InterlockedCompareExchange64(
-                               reinterpret_cast<volatile LONG64 *>(ptr),
-                               (LONG64)old_val,
-                               (LONG64)new_val) == (LONG64)old_val;
-               }
-               __forceinline static bool cas(volatile fixnum *ptr, fixnum old_val, fixnum new_val)
-               {
-                       return InterlockedCompareExchange64(
-                               reinterpret_cast<volatile LONG64 *>(ptr),
-                               (LONG64)old_val,
-                               (LONG64)new_val) == (LONG64)old_val;
-               }
+namespace atomic {
+__forceinline static bool cas(volatile cell* ptr, cell old_val, cell new_val) {
+  return InterlockedCompareExchange64(reinterpret_cast<volatile LONG64*>(ptr),
+                                      (LONG64)old_val, (LONG64)new_val) ==
+         (LONG64)old_val;
+}
+__forceinline static bool cas(volatile fixnum* ptr, fixnum old_val,
+                              fixnum new_val) {
+  return InterlockedCompareExchange64(reinterpret_cast<volatile LONG64*>(ptr),
+                                      (LONG64)old_val, (LONG64)new_val) ==
+         (LONG64)old_val;
+}
 
-               __forceinline static cell fetch_add(volatile cell *ptr, cell val)
-               {
-                       return (cell)InterlockedExchangeAdd64(
-                               reinterpret_cast<volatile LONG64 *>(ptr), (LONG64)val);
-               }
-               __forceinline static fixnum fetch_add(volatile fixnum *ptr, fixnum val)
-               {
-                       return (fixnum)InterlockedExchangeAdd64(
-                               reinterpret_cast<volatile LONG64 *>(ptr), (LONG64)val);
-               }
+__forceinline static cell fetch_add(volatile cell* ptr, cell val) {
+  return (cell)InterlockedExchangeAdd64(
+      reinterpret_cast<volatile LONG64*>(ptr), (LONG64)val);
+}
+__forceinline static fixnum fetch_add(volatile fixnum* ptr, fixnum val) {
+  return (fixnum)InterlockedExchangeAdd64(
+      reinterpret_cast<volatile LONG64*>(ptr), (LONG64)val);
+}
 
-               __forceinline static cell fetch_subtract(volatile cell *ptr, cell val)
-               {
-                       return (cell)InterlockedExchangeAdd64(
-                               reinterpret_cast<volatile LONG64 *>(ptr), -(LONG64)val);
-               }
-               __forceinline static fixnum fetch_subtract(volatile fixnum *ptr, fixnum val)
-               {
-                       return (fixnum)InterlockedExchangeAdd64(
-                               reinterpret_cast<volatile LONG64 *>(ptr), -(LONG64)val);
-               }
+__forceinline static cell fetch_subtract(volatile cell* ptr, cell val) {
+  return (cell)InterlockedExchangeAdd64(
+      reinterpret_cast<volatile LONG64*>(ptr), -(LONG64)val);
+}
+__forceinline static fixnum fetch_subtract(volatile fixnum* ptr, fixnum val) {
+  return (fixnum)InterlockedExchangeAdd64(
+      reinterpret_cast<volatile LONG64*>(ptr), -(LONG64)val);
+}
 
-               __forceinline static void fence()
-               {
-                       MemoryBarrier();
-               }
-       }
+__forceinline static void fence() { MemoryBarrier(); }
+}
 }
 
 #include "atomic.hpp"