aboutsummaryrefslogtreecommitdiff
path: root/types.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'types.cpp')
-rw-r--r--types.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/types.cpp b/types.cpp
index 7988c59..edeeb99 100644
--- a/types.cpp
+++ b/types.cpp
@@ -27,11 +27,22 @@ Pair::~Pair() {
gc.expose(cdr);
}
+void Pair::gc_decrement() {
+ if (car->is_container())
+ static_cast<Container*>(car)->gc_refs--;
+ if (cdr->is_container())
+ static_cast<Container*>(cdr)->gc_refs--;
+}
+
+void Pair::gc_trigger(EvalObj ** &tail) {
+ *tail++ = car;
+ *tail++ = cdr;
+}
+
ReprCons *Pair::get_repr_cons() {
return new PairReprCons(this, this);
}
-
ParseBracket::ParseBracket(unsigned char _btype) :
FrameObj(CLS_SIM_OBJ | CLS_PAR_BRA), btype(_btype) {}