[MLton-commit] r6626

spoons at mlton.org spoons at mlton.org
Thu May 29 11:00:46 PDT 2008


avoid intel-specific inlined-asm

----------------------------------------------------------------------

U   mlton/branches/shared-heap-multicore/runtime/gc/parallel.c

----------------------------------------------------------------------

Modified: mlton/branches/shared-heap-multicore/runtime/gc/parallel.c
===================================================================
--- mlton/branches/shared-heap-multicore/runtime/gc/parallel.c	2008-05-18 03:13:49 UTC (rev 6625)
+++ mlton/branches/shared-heap-multicore/runtime/gc/parallel.c	2008-05-29 18:00:40 UTC (rev 6626)
@@ -102,18 +102,19 @@
 
 Int32 Parallel_fetchAndAdd (pointer p, Int32 v) {
   //fprintf (stderr, "fetchAndAdd\n");
+
+  Int32 res = __sync_fetch_and_add ((Int32 *)p, v);
   /*
-  Int32 res = __sync_fetch_and_add ((Int32 *)p, v);
   asm volatile ("mfence");
   */
-
+  /*
   asm volatile ("lock; xaddl %0,%1"
                 : "+q" (v) // output
                 : "m" (*p) // input
                 : "memory"); // clobbered
   //  asm volatile ("mfence");
-
-  return v;
+  */
+  return res;
 }
 
 bool Parallel_compareAndSwap (pointer p, Int32 old, Int32 new) {




More information about the MLton-commit mailing list