1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-24 20:30:28 +02:00

scm_i_make_continuation takes vm and vm_cont args explicitly

* libguile/continuations.h:
* libguile/continuations.c (scm_i_make_continuation): Take VM and VM
  continuation arguments as well; I'm not convinced that saving all VM
  continuations was the right thing, and in any case we only ever saved
  the latest. Running a new VM should create a continuation barrier.

* libguile/stacks.c (scm_make_stack):
* libguile/vm-i-system.c (call/cc, tail-call/cc): Adapt callers.

* libguile/vm.h (scm_i_vm_capture_continuation)
  (scm_i_vm_reinstate_continuation): Change to be internal, and to only
  capture and reinstate continuations for a particular VM.
This commit is contained in:
Andy Wingo 2010-02-07 14:50:51 +01:00
parent 997659f898
commit 269479e31f
6 changed files with 20 additions and 22 deletions

View file

@ -137,17 +137,15 @@ reinstate_vm_cont (struct scm_vm *vp, SCM cont)
call to vm_run; but that's currently not implemented.
*/
SCM
scm_vm_capture_continuations (void)
scm_i_vm_capture_continuation (SCM vm)
{
SCM vm = scm_the_vm ();
return scm_acons (vm, capture_vm_cont (SCM_VM_DATA (vm)), SCM_EOL);
return capture_vm_cont (SCM_VM_DATA (vm));
}
void
scm_vm_reinstate_continuations (SCM conts)
scm_i_vm_reinstate_continuation (SCM vm, SCM cont)
{
for (; conts != SCM_EOL; conts = SCM_CDR (conts))
reinstate_vm_cont (SCM_VM_DATA (SCM_CAAR (conts)), SCM_CDAR (conts));
reinstate_vm_cont (SCM_VM_DATA (vm), cont);
}
static void