Add runtime support for STM Barrier class
[IRC.git] / Robust / src / Runtime / runtime.h
index d6e332be67935f8f984572ac4868255540dca573..032eb29f3d94d248051289a85f3d2d6f96c6ccf5 100644 (file)
@@ -8,6 +8,14 @@ extern int failurecount;
 #include "dstm.h"
 #endif
 
+#ifndef INTPTR
+#ifdef BIT64
+#define INTPTR long
+#else
+#define INTPTR int
+#endif
+#endif
+
 extern void * curr_heapbase;
 extern void * curr_heaptop;
 
@@ -27,21 +35,26 @@ extern void * curr_heaptop;
 #endif
 
 #ifdef DSTM
-void * allocate_newglobal(transrecord_t *, int type);
-struct ArrayObject * allocate_newarrayglobal(transrecord_t *, int type, int length);
+__attribute__((malloc)) void * allocate_newglobal(int type);
+__attribute__((malloc)) struct ArrayObject * allocate_newarrayglobal(int type, int length);
+#endif
+
+#ifdef STM
+__attribute__((malloc)) void * allocate_newtrans(void * ptr, int type);
+__attribute__((malloc)) struct ArrayObject * allocate_newarraytrans(void * ptr, int type, int length);
 #endif
 
 #ifdef PRECISE_GC
 #include "garbage.h"
-void * allocate_new(void *, int type);
-struct ArrayObject * allocate_newarray(void *, int type, int length);
-struct ___String___ * NewString(void *, const char *str,int length);
-struct ___TagDescriptor___ * allocate_tag(void *ptr, int index);
+__attribute__((malloc)) void * allocate_new(void *, int type);
+__attribute__((malloc)) struct ArrayObject * allocate_newarray(void *, int type, int length);
+__attribute__((malloc)) struct ___String___ * NewString(void *, const char *str,int length);
+__attribute__((malloc)) struct ___TagDescriptor___ * allocate_tag(void *ptr, int index);
 #else
-void * allocate_new(int type);
-struct ArrayObject * allocate_newarray(int type, int length);
-struct ___String___ * NewString(const char *str,int length);
-struct ___TagDescriptor___ * allocate_tag(int index);
+__attribute__((malloc)) void * allocate_new(int type);
+__attribute__((malloc)) struct ArrayObject * allocate_newarray(int type, int length);
+__attribute__((malloc)) struct ___String___ * NewString(const char *str,int length);
+__attribute__((malloc)) struct ___TagDescriptor___ * allocate_tag(int index);
 #endif
 
 
@@ -111,6 +124,10 @@ struct RuntimeHash * lockRedirectTbl;
 #endif
 #endif
 
+#ifdef FASTCHECK
+extern struct ___Object___ * ___fcrevert___;
+#endif
+
 #ifdef MULTICORE
 void flagorand(void * ptr, int ormask, int andmask, struct parameterwrapper ** queues, int length);
 void flagorandinit(void * ptr, int ormask, int andmask);