code changes...fix all of the statistics collection...clean up collection code
[IRC.git] / Robust / src / Runtime / mem.h
index 954019ee0723b3c6665e961996e9a07381cb2f6b..a2ae634c38a618c164c5044a0b2bab8910aefc52 100644 (file)
 #else
 #ifdef PRECISE_GC
 #include "garbage.h"
-#define RUNMALLOC(x) calloc(1,x)
-#define RUNFREE(x) free(x)
+#ifdef COREPROF
+#include "coreprof.h"
+#define RUNMALLOC(x) cp_calloc(x)
+#define RUNFREE(x) cp_free(x)
 #else
-#ifdef MULTICORE
-#ifdef THREADSIMULATE
-#define FREEMALLOC(x) calloc(1,x)
 #define RUNMALLOC(x) calloc(1,x)
 #define RUNFREE(x) free(x)
-//#define PTR(x) (x)
+#endif
 #else
-void * mycalloc(int m, int size);
-void * mycalloc_i(int m, int size);
+#ifdef MULTICORE
+void * mycalloc(int size, char * file, int line);
+void * mycalloc_i(int size, char * file, int line);
 void myfree(void * ptr);
-#define FREEMALLOC(x) mycalloc(1,x)
-#define RUNMALLOC(x) mycalloc(1,x) // handle interruption inside
-#define RUNMALLOC_I(x) mycalloc_i(1,x) // with interruption blocked beforehand
-#define RUNFREE(x) myfree(x);
-//#define PTR(x) (32+(x-1)&~31)
-#endif  // #ifdef THREADSIMULATE
+void myfree_i(void * ptr);
+
+#define RUNMALLOC(x) mycalloc(x,__FILE__,__LINE__) // handle interruption inside
+#define RUNCALLOC(x) mycalloc(x,__FILE__,__LINE__) // handle interruption inside
+#define RUNMALLOC_I(x) mycalloc_i(x,__FILE__,__LINE__) //with interruption blocked beforehand
+#define RUNCALLOC_I(x) mycalloc_i(x,__FILE__,__LINE__) //with interruption blocked beforehand
+
+#define RUNFREE(x) myfree(x)
+#define RUNFREE_I(x) myfree_i(x)
+#if defined(MULTICORE_GC)||defined(PMC_GC)
+#include "multicoregc.h"
+void * mycalloc_share(struct garbagelist * stackptr, int size);
+void * mycalloc_share_ngc(int size);
+void * mycalloc_share_ngc_I(int size);
+void mycalloc_free_ngc(void * ptr);
+void mycalloc_free_ngc_I(void * ptr);
+#define FREEMALLOC(s, x) mycalloc_share(s,x)
+#else
+void * mycalloc_share(int size);
+#define FREEMALLOC(x) mycalloc_share(x)
+#endif // #ifdef MULTICORE_GC
 #endif  // #ifdef MULTICORE
 #endif  // #ifdef PRECISE_GC
 #endif  // #ifdef BOEHM_GC