diff options
author | Teddy <[email protected]> | 2013-08-14 23:28:20 +0800 |
---|---|---|
committer | Teddy <[email protected]> | 2013-08-14 23:28:20 +0800 |
commit | addbfae58d8afceb06d92f6ef1cdfed89c07518b (patch) | |
tree | 22668b260beac6177871ea5570452c5bfdedd08f /eval.cpp | |
parent | 640a20d0b6a2137617b7f217defce7979338e289 (diff) |
significant improvement on gc efficiency
Diffstat (limited to 'eval.cpp')
-rw-r--r-- | eval.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -11,7 +11,11 @@ EvalObj *eval_stack[EVAL_STACK_SIZE]; void Evaluator::add_builtin_routines() { #define ADD_ENTRY(name, rout) \ - envt->add_binding(new SymObj(name), rout) +do { \ + SymObj *tmp = new SymObj(name); \ + envt->add_binding(tmp, rout); \ + delete tmp; \ +} while (0) #define ADD_BUILTIN_PROC(name, rout) \ ADD_ENTRY(name, new BuiltinProcObj(rout, name)) |