mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-15 08:10:17 +02:00
add vm-abort-continuation-hook, vm-restore-continuation-hook
* libguile/vm-i-system.c (call_cc, tail_call_cc): Call the new RESTORE_CONTINUATION_HOOK when a continuation is restored. (prompt): Call the new ABORT_CONTINUATION_HOOK when entering the abort handler's continuation. * libguile/vm-engine.h (ABORT_CONTINUATION_HOOK) (RESTORE_CONTINUATION_HOOK): * libguile/vm.h (SCM_VM_ABORT_CONTINUATION_HOOK) (SCM_VM_RESTORE_CONTINUATION_HOOK): * libguile/vm.c: (scm_vm_abort_continuation_hook): New hook, called when entering an abort handler. (scm_vm_restore_continuation_hook): New hook, called after returning to a continuation. * module/system/vm/vm.scm: Add hooks to export list.
This commit is contained in:
parent
c45d4d775d
commit
f312025167
5 changed files with 47 additions and 5 deletions
|
@ -232,6 +232,10 @@
|
|||
RUN_HOOK1 (SCM_VM_POP_CONTINUATION_HOOK, SCM_I_MAKINUM (n))
|
||||
#define NEXT_HOOK() \
|
||||
RUN_HOOK (SCM_VM_NEXT_HOOK)
|
||||
#define ABORT_CONTINUATION_HOOK() \
|
||||
RUN_HOOK (SCM_VM_ABORT_CONTINUATION_HOOK)
|
||||
#define RESTORE_CONTINUATION_HOOK() \
|
||||
RUN_HOOK (SCM_VM_RESTORE_CONTINUATION_HOOK)
|
||||
|
||||
#define VM_HANDLE_INTERRUPTS \
|
||||
SCM_ASYNC_TICK_WITH_CODE (SYNC_REGISTER ())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue