start of new file
[IRC.git] / Robust / src / Runtime / mem.h
index ed9270996522fa8b3547c600b525ce46624a2ca6..fa82a2c387dfc47a5b57a9dbea92958792f7a1a6 100644 (file)
@@ -1,7 +1,9 @@
 #ifndef MEMH
 #define MEMH
 #include<stdlib.h>
+#ifndef RAW
 #include<stdio.h>
+#endif
 
 #ifdef BOEHM_GC
 #include "gc.h"
 #define RUNMALLOC(x) calloc(1,x)
 #define RUNFREE(x) free(x)
 #else
+#ifdef RAW
+void * mycalloc(int m, int size);
+void * mycalloc_i(int m, int size);
+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)
+#else
 #define FREEMALLOC(x) calloc(1,x)
 #define RUNMALLOC(x) calloc(1,x)
 #define RUNFREE(x) free(x)
+//#define PTR(x) (x)
+#endif
 #endif
 #endif
 #endif