diff options
author | Teddy <ted.sybil@gmail.com> | 2013-08-15 08:30:12 +0800 |
---|---|---|
committer | Teddy <ted.sybil@gmail.com> | 2013-08-15 08:30:12 +0800 |
commit | 3c6e957edadd896e15c32c5f7765913c8ad4d63c (patch) | |
tree | 3973035dcf7b3789bb98b10e6eb50d0b428ee5c7 /model.h | |
parent | addbfae58d8afceb06d92f6ef1cdfed89c07518b (diff) |
tail-recursion opt in user-def call
Diffstat (limited to 'model.h')
-rw-r--r-- | model.h | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -21,16 +21,25 @@ const int CLS_CONTAINER = 1 << 20; #define TO_PAIR(ptr) \ (static_cast<Pair*>(ptr)) -#define EXIT_CURRENT_CONT(lenvt, cont) \ +#define EXIT_CURRENT_ENVT(lenvt) \ do { \ gc.expose(lenvt); \ lenvt = cont->envt; \ gc.attach(lenvt); \ + } while (0) +#define EXIT_CURRENT_CONT(cont) \ + do { \ gc.expose(cont); \ cont = cont->prev_cont; \ gc.attach(cont); \ } while (0) +#define EXIT_CURRENT_EXEC(lenvt, cont) \ + do { \ + EXIT_CURRENT_ENVT(lenvt); \ + EXIT_CURRENT_CONT(cont); \ + } while (0) + /** @class FrameObj * Objects that can be held in the evaluation stack */ |