diff options
author | Teddy <[email protected]> | 2013-08-13 00:31:11 +0800 |
---|---|---|
committer | Teddy <[email protected]> | 2013-08-13 00:31:11 +0800 |
commit | 79a2ecc929b30ae40f9324c258d8ded99ecde259 (patch) | |
tree | d90ca620d8b5ffb805add4aa3c044326ab459cdc /eval.cpp | |
parent | ca12d00e80d76214d44443bf4f5e62554e526089 (diff) |
gc can now work
Diffstat (limited to 'eval.cpp')
-rw-r--r-- | eval.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -92,6 +92,7 @@ void Evaluator::add_builtin_routines() { Evaluator::Evaluator() { envt = new Environment(NULL); // Top-level Environment + gc.attach(envt); add_builtin_routines(); } @@ -175,10 +176,17 @@ EvalObj *Evaluator::run_expr(Pair *prog) { cont->proc_body = nexp; if (nexp == empty_list) { - *top_ptr = args->car; + *top_ptr = gc.attach(args->car); + + gc.expose(envt); envt = cont->envt; + gc.attach(envt); + pc = cont->pc->next; + + gc.expose(cont); cont = cont->prev_cont; + gc.attach(cont); } else pc = nexp; top_ptr++; |