Automatically enable Bohem's GC if available.
[nit.git] / lib / nit_common.h
index e0b22bf..02e3dff 100644 (file)
@@ -5,6 +5,12 @@
 #include <stdio.h>
 #include <string.h>
 
+#ifdef WITH_LIBGC
+#include <gc/gc.h>
+#define malloc(x) GC_MALLOC((x))
+#define calloc(x,y) GC_MALLOC((x)*(y))
+#endif
+
 /* *** Types *** */
 typedef int (*fun_t)(int);                                     /* generic function pointer */
 typedef unsigned int cid_t;                                    /* class identifier */