diff options
author | Teddy <ted.sybil@gmail.com> | 2013-08-13 22:07:31 +0800 |
---|---|---|
committer | Teddy <ted.sybil@gmail.com> | 2013-08-13 22:07:31 +0800 |
commit | fcb069b98bb6a2f59e5ebfd2ad0ab5ee82a1bdb8 (patch) | |
tree | 72ee9cea7cc35bef2971eb5de85806eb07f20fb8 /model.h | |
parent | 9982fba5f471944a2e5ab1edac97c971eb557416 (diff) |
add cycle detect for `Pair`, `ProcObj`, `Envt` and `Cont`
Diffstat (limited to 'model.h')
-rw-r--r-- | model.h | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -2,6 +2,7 @@ #define MODEL_H #include <string> +#include <set> using std::string; @@ -103,12 +104,14 @@ class EvalObj : public FrameObj { virtual ReprCons *get_repr_cons() = 0; }; +typedef std::set<EvalObj*> EvalObjSet; class Container: public EvalObj { public: + bool keep; size_t gc_refs; - Container(int otype); + Container(int otype = 0); virtual void gc_decrement() = 0; - virtual void gc_trigger(EvalObj ** &tail) = 0; + virtual void gc_trigger(EvalObj ** &tail, EvalObjSet &visited) = 0; }; /** @class RetAddr |