27249ca0a64c87e776eab8ed61bd072b68828deb
[repair.git] / Repair / RepairCompiler / MCC / Runtime / tmap.h
1 #ifndef TMAP_H
2 #define TMAP_H
3 #include "classlist.h"
4
5 class typemap {
6  public:
7   typemap(typeobject *);
8   ~typemap();
9   void allocate(void *, int);
10   void deallocate(void *);
11   bool assertvalidmemory(void* low, void* high);
12   bool asserttype(void *ptr, void *high, int structure);
13   bool assertvalidmemory(void* low, int structure);
14   bool asserttype(void *ptr, int structure);
15   bool istype(void *ptr, void *high, int structure);
16   void reset();
17   typeobject *size;
18  private:
19   bool checkmemory(void* low, void* high);
20   bool checktype(bool doaction,void *ptr, int structure);
21   bool checktype(bool doaction, void *low, void *high,int structure, struct rbtree *ttree);
22   int findoffsetstructure(int s, int offset);
23   struct rbtree *alloctree;
24   struct rbtree *typetree;
25 };
26
27 class structuremap {
28   public:
29   structuremap(int s);
30   ~structuremap();
31   int str;
32   struct rbtree *typetree;
33 };
34 #endif