From 9982fba5f471944a2e5ab1edac97c971eb557416 Mon Sep 17 00:00:00 2001 From: Teddy Date: Tue, 13 Aug 2013 20:44:03 +0800 Subject: fixed a mem leak in parser.cpp --- types.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'types.cpp') 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(car)->gc_refs--; + if (cdr->is_container()) + static_cast(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) {} -- cgit v1.2.3