summaryrefslogtreecommitdiff
path: root/libguile/init.c
diff options
context:
space:
mode:
authorGary Houston <ghouston@arglist.com>2000-11-25 16:58:25 +0000
committerGary Houston <ghouston@arglist.com>2000-11-25 16:58:25 +0000
commit5f144b105db0dcbe3b33947317d3e9b98cbd5269 (patch)
treeb2491ba314e94a35b79871c086523d79192f5e91 /libguile/init.c
parent7f555fb4ed423ad783c961bed500c19d3159886a (diff)
downloadguile-5f144b105db0dcbe3b33947317d3e9b98cbd5269.tar.gz
* use an applicable SMOB to represent continuations, instead of a
custom tc7 type. This will make it easier to support R5RS multiple value continuations, without the use of a Scheme-level wrapper. * continuations.c (scm_tc16_continuation, continuation_mark, continuation_free, continuation_print, continuation_apply): new SMOB support. (scm_make_continuation): new procedure, replaces scm_make_cont with a different interface. (copy_stack_and_call, scm_dynthrow, scm_init_continuations): rewritten. (CHEAP_CONTINUATIONS): removed non-working code completely. (scm_call_continuation): removed. * continuations.h (struct scm_contregs): add num_stack_items and stack fields. previously stack was stored following this struct: use a tail array instead. (SCM_CONTINUATIONP): new macro. (SCM_CONTINUATION_LENGTH, SCM_SET_CONTINUATION_LENGTH): rewritten. (SCM_SET_CONTREGS): removed. * tags.h: removed scm_tc7_contin (was tag 61). * debug.c, gc.c, hash.c, print.c, procprop.c, procs.c: removed scm_tc7_contin support. * eval.c: use scm_make_continuation instead of scm_make_cont. don't set jump buffers here. remove scm_tc7_contin support. * init.c, root.c: create SMOB continuation for rootcont instead of scm_tc7_contin. call scm_init_continuations before scm_init_root. * root.c: remove support for static jmpbuf. It's not used by default and I broke it. create SMOB continuation for rootcont. * stacks.c: use SCM_CONTINUATIONP.
Diffstat (limited to 'libguile/init.c')
-rw-r--r--libguile/init.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/libguile/init.c b/libguile/init.c
index 19530f6b6..16211518a 100644
--- a/libguile/init.c
+++ b/libguile/init.c
@@ -183,11 +183,13 @@ start_stack (void *base)
/* Create an object to hold the root continuation.
*/
- SCM_NEWCELL (scm_rootcont);
- SCM_SET_CONTREGS (scm_rootcont, scm_must_malloc (sizeof (scm_contregs),
- "continuation"));
- SCM_SET_CELL_TYPE (scm_rootcont, scm_tc7_contin);
- SCM_SEQ (scm_rootcont) = 0;
+ {
+ scm_contregs *contregs = scm_must_malloc (sizeof (scm_contregs),
+ "continuation");
+ contregs->num_stack_items = 0;
+ contregs->seq = 0;
+ SCM_NEWSMOB (scm_rootcont, scm_tc16_continuation, contregs);
+ }
/* The root continuation is further initialized by restart_stack. */
/* Create the look-aside stack for variables that are shared between
@@ -488,6 +490,7 @@ scm_init_guile_1 (SCM_STACKITEM *base)
scm_weaks_prehistory (); /* Must come after scm_init_storage */
scm_init_subr_table ();
scm_environments_prehistory (); /* create the root environment */
+ scm_init_continuations ();
scm_init_root ();
#ifdef USE_THREADS
scm_init_threads (base);
@@ -501,7 +504,6 @@ scm_init_guile_1 (SCM_STACKITEM *base)
scm_init_async ();
scm_init_boolean ();
scm_init_chars ();
- scm_init_continuations ();
#ifdef GUILE_DEBUG_MALLOC
scm_init_debug_malloc ();
#endif