start of new file
[IRC.git] / Robust / src / Runtime / mem.h
1 #ifndef MEMH
2 #define MEMH
3 #include<stdlib.h>
4 #ifndef RAW
5 #include<stdio.h>
6 #endif
7
8 #ifdef BOEHM_GC
9 #include "gc.h"
10 #define FREEMALLOC(x) GC_malloc(x)
11 #define RUNMALLOC(x) GC_malloc(x)
12 #define RUNFREE(x)
13 #else
14 #ifdef PRECISE_GC
15 #include "garbage.h"
16 #define RUNMALLOC(x) calloc(1,x)
17 #define RUNFREE(x) free(x)
18 #else
19 #ifdef RAW
20 void * mycalloc(int m, int size);
21 void * mycalloc_i(int m, int size);
22 void myfree(void * ptr);
23 #define FREEMALLOC(x) mycalloc(1,x)
24 #define RUNMALLOC(x) mycalloc(1,x) // handle interruption inside
25 #define RUNMALLOC_I(x) mycalloc_i(1,x) // with interruption blocked beforehand
26 #define RUNFREE(x) myfree(x);
27 //#define PTR(x) (32+(x-1)&~31)
28 #else
29 #define FREEMALLOC(x) calloc(1,x)
30 #define RUNMALLOC(x) calloc(1,x)
31 #define RUNFREE(x) free(x)
32 //#define PTR(x) (x)
33 #endif
34 #endif
35 #endif
36 #endif