From 7059ee97ac8ac1c37b9e09d725705d2f1d8340ef Mon Sep 17 00:00:00 2001 From: Benjamin Vedder Date: Sat, 1 Oct 2022 10:58:20 +0200 Subject: [PATCH] Squashed 'lispBM/lispBM/' changes from 8293dc85..337ecc93 337ecc93 fix bugs related to wait git-subtree-dir: lispBM/lispBM git-subtree-split: 337ecc930ca82869096543128d93843a961b4dfa --- doc/lbmref.md | 21 +++++++++++++++++++++ src/eval_cps.c | 3 ++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/doc/lbmref.md b/doc/lbmref.md index bd642f13..0bb67748 100644 --- a/doc/lbmref.md +++ b/doc/lbmref.md @@ -676,6 +676,27 @@ Example ``` --- +### undefine + +A definition in the global can be removed using undefine. The form of +an undefine expression is `(undefine name-expr)` where name-expr +should evaluate to a symbol (for example `'apa`). + +Example +```lisp +(undefine 'apa) +``` + +It is also possible to undefine several bindings at the same time by +providing a list of names. + +Example +```lisp +(undefine '(apa bepa cepa)) +``` + +--- + ### setvar The `setvar` form is used to change the value of some variable in an environment. diff --git a/src/eval_cps.c b/src/eval_cps.c index 0cd7eb3d..6d08f039 100644 --- a/src/eval_cps.c +++ b/src/eval_cps.c @@ -504,7 +504,6 @@ static void finish_ctx(void) { if (!ctx_running) { return; } - /* Drop the continuation stack immediately to free up lbm_memory */ lbm_stack_free(&ctx_running->K); @@ -515,6 +514,7 @@ static void finish_ctx(void) { lbm_memory_free((lbm_uint*)ctx_running->error_reason); } + lbm_memory_free((lbm_uint*) ctx_running->mailbox); lbm_memory_free((lbm_uint*)ctx_running); ctx_running = NULL; } @@ -1578,6 +1578,7 @@ static inline void cont_wait(eval_context_t *ctx) { lbm_blocked_iterator(context_exists, &cid, &exists); lbm_running_iterator(context_exists, &cid, &exists); + lbm_sleeping_iterator(context_exists, &cid, &exists); if (ctx_running->id == cid) { exists = true;