diff options
author | Teddy <ted.sybil@gmail.com> | 2013-08-13 23:47:38 +0800 |
---|---|---|
committer | Teddy <ted.sybil@gmail.com> | 2013-08-13 23:47:38 +0800 |
commit | faab1d57661e4d68823723a8270205c3a3c6e148 (patch) | |
tree | 0117a8d3a07f4d3be91eee01475787d2eb47a5fc /types.h | |
parent | fcb069b98bb6a2f59e5ebfd2ad0ab5ee82a1bdb8 (diff) |
add gc in `PromObj` and `Continuation`
Diffstat (limited to 'types.h')
-rw-r--r-- | types.h | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -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 |