unrelacy: add some helpers for cleaning up relacy code
authorBrian Norris <banorris@uci.edu>
Wed, 10 Oct 2012 01:05:33 +0000 (18:05 -0700)
committerBrian Norris <banorris@uci.edu>
Wed, 10 Oct 2012 01:05:33 +0000 (18:05 -0700)
Relacy still uses a few things that I can't easily add, like a ()
operator for std::atomic<T>. We'll still have to replace some things by
hand in test cases written for Relacy.

benchmarks.mk
include/unrelacy.h [new file with mode: 0644]

index d47b6d6..eeb2f74 100644 (file)
@@ -9,7 +9,7 @@ LIB_NAME = model
 LIB_SO = lib$(LIB_NAME).so
 
 BASE = ../..
-INCLUDE = -I$(BASE)/include  -I$(BASE)
+INCLUDE = -I$(BASE)/include  -I$(BASE) -I../include
 CPPFLAGS += $(INCLUDE)
 CFLAGS += $(INCLUDE)
 LDFLAGS += -L$(BASE) -l$(LIB_NAME)
diff --git a/include/unrelacy.h b/include/unrelacy.h
new file mode 100644 (file)
index 0000000..f4d75e8
--- /dev/null
@@ -0,0 +1,29 @@
+#include <stdatomic.h>
+
+#define $
+
+/* Should re-define to something meaningful */
+#define ASSERT(expr)
+
+#define mo_seqcst memory_order_relaxed
+#define mo_release memory_order_release
+#define mo_acquire memory_order_acquire
+#define mo_acq_rel memory_order_acq_rel
+#define mo_relaxed memory_order_relaxed
+
+namespace rl {
+
+       class backoff_t
+       {
+        public:
+               typedef int debug_info_param;
+               void yield(debug_info_param info) { }
+               void yield() { }
+       };
+
+
+       typedef backoff_t backoff;
+       typedef backoff_t linear_backoff;
+       typedef backoff_t exp_backoff;
+
+}