aboutsummaryrefslogtreecommitdiff
path: root/model.h
diff options
context:
space:
mode:
authorTeddy <ted.sybil@gmail.com>2013-08-14 23:28:20 +0800
committerTeddy <ted.sybil@gmail.com>2013-08-14 23:28:20 +0800
commitaddbfae58d8afceb06d92f6ef1cdfed89c07518b (patch)
tree22668b260beac6177871ea5570452c5bfdedd08f /model.h
parent640a20d0b6a2137617b7f217defce7979338e289 (diff)
significant improvement on gc efficiency
Diffstat (limited to 'model.h')
-rw-r--r--model.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/model.h b/model.h
index 9b5093e..8d272f8 100644
--- a/model.h
+++ b/model.h
@@ -63,6 +63,8 @@ class ReprCons;
* Objects that represents a value in evaluation
*/
class EvalObj : public FrameObj {
+ private:
+ size_t gc_cnt;
protected:
/**
* Report the type of the EvalObj, which can avoid the use of
@@ -77,6 +79,7 @@ class EvalObj : public FrameObj {
* CLS_SIM_OBJ
*/
EvalObj(int otype = CLS_SIM_OBJ);
+ ~EvalObj();
/** Check if the object is a simple object (instead of a call
* invocation)
* @return true if the object is not a construction (Pair)
@@ -107,6 +110,9 @@ class EvalObj : public FrameObj {
virtual bool is_true();
/** External representation construction */
virtual ReprCons *get_repr_cons() = 0;
+ bool gc_dec();
+ void gc_inc();
+ size_t gc_get_cnt();
};
typedef std::set<EvalObj*> EvalObjSet;