aboutsummaryrefslogtreecommitdiff
path: root/types.h
diff options
context:
space:
mode:
authorTeddy <ted.sybil@gmail.com>2013-08-13 23:47:38 +0800
committerTeddy <ted.sybil@gmail.com>2013-08-13 23:47:38 +0800
commitfaab1d57661e4d68823723a8270205c3a3c6e148 (patch)
tree0117a8d3a07f4d3be91eee01475787d2eb47a5fc /types.h
parentfcb069b98bb6a2f59e5ebfd2ad0ab5ee82a1bdb8 (diff)
add gc in `PromObj` and `Continuation`
Diffstat (limited to 'types.h')
-rw-r--r--types.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/types.h b/types.h
index 0633da1..7db90f5 100644
--- a/types.h
+++ b/types.h
@@ -139,7 +139,7 @@ class Continuation;
*/
class OptObj: public Container {/*{{{*/
public:
- OptObj();
+ OptObj(int otype = 0);
/**
* The function is called when an operation is needed.
* @param args The argument list (the first one is the opt itself)
@@ -300,7 +300,7 @@ class CharObj: public EvalObj {/*{{{*/
* @class VecObj
* Vector support (currently a wrapper of STL vector)
*/
-class VecObj: public EvalObj {/*{{{*/
+class VecObj: public Container {/*{{{*/
public:
EvalObjVec vec;
/** Construct a vector object */
@@ -315,13 +315,16 @@ class VecObj: public EvalObj {/*{{{*/
void set(size_t idx, EvalObj *obj);
EvalObj *get(size_t idx);
ReprCons *get_repr_cons();
+
+ void gc_decrement();
+ void gc_trigger(EvalObj ** &tail, EvalObjSet &visited);
};/*}}}*/
/**
* @class PromObj
* Promise support (partial)
*/
-class PromObj: public EvalObj {/*{{{*/
+class PromObj: public Container {/*{{{*/
private:
Pair *entry;
EvalObj *mem;
@@ -332,6 +335,9 @@ class PromObj: public EvalObj {/*{{{*/
EvalObj *get_mem();
void feed_mem(EvalObj *res);
ReprCons *get_repr_cons();
+
+ void gc_decrement();
+ void gc_trigger(EvalObj ** &tail, EvalObjSet &visited);
};/*}}}*/
/** @class Environment