return flag to indicate errors
[repair.git] / Repair / RepairCompiler / MCC / CRuntime / tmap.c
index bf03f04bada39ac855dcc5750b59d1d9e0b60708..6cf599a495ea6fe2892a846d3cf0436059efbf9b 100755 (executable)
 #endif
 
 struct typemap * allocatetypemap() {
+#ifdef CHECKTYPE||CHECKMEMORY
   struct typemap *thisvar=(struct typemap *) malloc(sizeof(struct typemap));
   thisvar->alloctree=rbinit();
   thisvar->typetree=rbinit();
   thisvar->low=GC_linux_stack_base();
   return thisvar;
+#else
+  return NULL;
+#endif
 }
 
 void freefunction(void *ptr) {
@@ -30,20 +34,24 @@ void freetypemap(struct typemap * ptr) {
 }
 
 void typemapreset(struct typemap *ptr) {
+#ifdef CHECKTYPE||CHECKMEMORY
   rbdestroy(ptr->typetree,freefunction);
   ptr->typetree=rbinit();
   if (ptr->low<ptr->high)
     rbdelete(ptr->low,ptr->alloctree);
   else
     rbdelete(ptr->high,ptr->alloctree);
+#endif
 }
 
 void initializetypemapstack(struct typemap * ptr, void *high) {
+#ifdef CHECKTYPE||CHECKMEMORY
   ptr->high=high;
   if (ptr->low<ptr->high)
     rbinsert(ptr->low,ptr->high,NULL,ptr->alloctree);
   else
     rbinsert(ptr->high,ptr->low,NULL,ptr->alloctree);
+#endif
 }
 
 struct structuremap * allocatestructuremap(int s) {