X-Git-Url: http://plrg.eecs.uci.edu/git/?p=repair.git;a=blobdiff_plain;f=Repair%2FRepairCompiler%2FMCC%2FRuntime%2Ftmap.h;h=85f8619f044d5acc251178c42e3133470578f97d;hp=535ecc56ec383f9d984560795c820f0de3d57852;hb=1a9b5106dbaf948defb63a97a3ffffde025a4e2c;hpb=464f810d8962b4a2622ba3bf5b5b9530373a93a0 diff --git a/Repair/RepairCompiler/MCC/Runtime/tmap.h b/Repair/RepairCompiler/MCC/Runtime/tmap.h index 535ecc5..85f8619 100755 --- a/Repair/RepairCompiler/MCC/Runtime/tmap.h +++ b/Repair/RepairCompiler/MCC/Runtime/tmap.h @@ -1,49 +1,36 @@ #ifndef TMAP_H #define TMAP_H #include "classlist.h" -#include "redblack.h" -#ifndef bool -#define bool int -#endif - -#ifndef true -#define true 1 -#endif - -#ifndef false -#define false 0 -#endif - -struct typemap * allocatetypemap(); -void freetypemap(struct typemap *); -void typemapreset(struct typemap *); -void initializetypemapstack(struct typemap *, void *high); - -void typemapallocate(struct typemap *, void *, int); -void typemapdeallocate(struct typemap *, void *); -bool typemapassertvalidmemoryB(struct typemap *, void* low, void* high); -bool typemapasserttypeB(struct typemap *, void *ptr, void *high, int structure); -bool typemapassertvalidmemory(struct typemap *, void* low, int structure); -bool typemapasserttype(struct typemap *, void *ptr, int structure); -bool typemapistype(struct typemap *, void *ptr, void *high, int structure); -bool typemapcheckmemory(struct typemap *, void* low, void* high); -bool typemapchecktype(struct typemap *, bool doaction,void *ptr, int structure); -bool typemapchecktypeB(struct typemap *, bool doaction, void *low, void *high,int structure, struct rbtree *ttree); -int typemapfindoffsetstructure(struct typemap *, int s, int offset); - - -struct typemap { +class typemap { + public: + typemap(typeobject *); + ~typemap(); + void allocate(void *, int); + void deallocate(void *); + bool assertvalidmemory(void* low, void* high); + bool asserttype(void *ptr, void *high, int structure); + bool assertvalidmemory(void* low, int structure); + bool asserttype(void *ptr, int structure); + bool istype(void *ptr, void *high, int structure); + void reset(); + typeobject *size; + void initializestack(void *high); + private: void *low; void *high; + bool checkmemory(void* low, void* high); + bool checktype(bool doaction,void *ptr, int structure); + bool checktype(bool doaction, void *low, void *high,int structure, struct rbtree *ttree); + int findoffsetstructure(int s, int offset); struct rbtree *alloctree; struct rbtree *typetree; }; -struct structuremap * allocatestructuremap(int s); -void freestructuremap(struct structuremap *); - -struct structuremap { +class structuremap { + public: + structuremap(int s); + ~structuremap(); int str; struct rbtree *typetree; };