Add runtime support for STM Barrier class
[IRC.git] / Robust / src / Runtime / runtime.h
index 0a5374bde24f1de6c8f43ad71b4a3c6326a01e70..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
 
 
@@ -106,6 +119,13 @@ struct transObjInfo {
   int * queues;
   int length;
 };
+#ifdef RAW
+struct RuntimeHash * lockRedirectTbl;
+#endif
+#endif
+
+#ifdef FASTCHECK
+extern struct ___Object___ * ___fcrevert___;
 #endif
 
 #ifdef MULTICORE
@@ -114,7 +134,12 @@ void flagorandinit(void * ptr, int ormask, int andmask);
 void enqueueObject(void * ptr, struct parameterwrapper ** queues, int length);
 #ifdef RAW
 void enqueueObject_I(void * ptr, struct parameterwrapper ** queues, int length);
+#ifdef RAWPROFILE
+inline void setTaskExitIndex(int index);
+inline void addNewObjInfo(void * nobj);
+#endif
 #endif
+int * getAliasLock(void ** ptrs, int length, struct RuntimeHash * tbl);
 void addAliasLock(void * ptr, int lock);
 #else
 void flagorand(void * ptr, int ormask, int andmask);