diff options
-rw-r--r-- | libguile/ChangeLog | 15 | ||||
-rw-r--r-- | libguile/continuations.c | 10 | ||||
-rw-r--r-- | libguile/continuations.h | 18 | ||||
-rw-r--r-- | libguile/init.c | 4 | ||||
-rw-r--r-- | libguile/root.c | 12 |
5 files changed, 39 insertions, 20 deletions
diff --git a/libguile/ChangeLog b/libguile/ChangeLog index 56350e194..b6a537e33 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,5 +1,20 @@ 2000-03-28 Dirk Herrmann <D.Herrmann@tu-bs.de> + * continuations.h (SCM_CONTREGS, SCM_SET_CONTREGS): New macros to + access continuation data. + + (SCM_SETJMPBUF): Deprecated. Use SCM_SET_CONTREGS instead. + + (SCM_JMPBUF, SCM_DYNENV, SCM_THROW_VALUE, SCM_BASE, SCM_SEQ, + SCM_DFRAME): Use SCM_CONTREGS instead of SCM_CHARS to access + continuation data. + + * continuations.c (scm_make_cont), init.c (start_stack), + root.c (scm_internal_cwdr): Use SCM_SET_CONTREGS instead of + SCM_SETJMPBUF. + +2000-03-28 Dirk Herrmann <D.Herrmann@tu-bs.de> + * symbols.h (SCM_LENGTH, SCM_SETLENGTH): Access the length field of strings and symbols by using SCM_{SET_}?CELL_WORD_0. diff --git a/libguile/continuations.c b/libguile/continuations.c index dd9b6e07a..ec554caaf 100644 --- a/libguile/continuations.c +++ b/libguile/continuations.c @@ -72,7 +72,7 @@ scm_make_cont (SCM *answer) SCM_NEWCELL (cont); *answer = cont; SCM_ENTER_A_SECTION; - SCM_SETJMPBUF (cont, scm_must_malloc ((long) sizeof (scm_contregs), s_cont)); + SCM_SET_CONTREGS (cont, scm_must_malloc (sizeof (scm_contregs), s_cont)); SCM_DYNENV (cont) = scm_dynwinds; SCM_THROW_VALUE = SCM_EOL; SCM_BASE (cont) = SCM_BASE (rootcont); @@ -101,10 +101,10 @@ scm_make_cont (SCM *answer) SCM_ENTER_A_SECTION; SCM_FLUSH_REGISTER_WINDOWS; j = scm_stack_size (SCM_BASE (scm_rootcont)); - SCM_SETJMPBUF (cont, - scm_must_malloc (sizeof (scm_contregs) - + j * sizeof (SCM_STACKITEM), - s_cont)); + SCM_SET_CONTREGS (cont, + scm_must_malloc (sizeof (scm_contregs) + + j * sizeof (SCM_STACKITEM), + s_cont)); SCM_DYNENV (cont) = scm_dynwinds; SCM_THROW_VALUE (cont) = SCM_EOL; src = SCM_BASE (cont) = SCM_BASE (scm_rootcont); diff --git a/libguile/continuations.h b/libguile/continuations.h index 9847d7166..85505d351 100644 --- a/libguile/continuations.h +++ b/libguile/continuations.h @@ -60,13 +60,17 @@ typedef struct #endif } scm_contregs; -#define SCM_JMPBUF(x) (((scm_contregs *)SCM_CHARS(x))->jmpbuf) -#define SCM_SETJMPBUF(z, x) SCM_SETCDR (z, (SCM) x) -#define SCM_DYNENV(x) (((scm_contregs *)SCM_CHARS(x))->dynenv) -#define SCM_THROW_VALUE(x) (((scm_contregs *)SCM_CHARS(x))->throw_value) -#define SCM_BASE(x) (((scm_contregs *)SCM_CHARS(x))->base) -#define SCM_SEQ(x) (((scm_contregs *)SCM_CHARS(x))->seq) -#define SCM_DFRAME(x) (((scm_contregs *)SCM_CHARS(x))->dframe) + +#define SCM_CONTREGS(x) ((scm_contregs *) SCM_CELL_WORD_1 (x)) +#define SCM_SET_CONTREGS(x, r) (SCM_SET_CELL_WORD_1 ((x), (scm_bits_t) (r))) +#define SCM_SETJMPBUF(x, r) (SCM_SET_CONTREGS ((x), (r))) /* deprecated */ + +#define SCM_JMPBUF(x) ((SCM_CONTREGS (x))->jmpbuf) +#define SCM_DYNENV(x) ((SCM_CONTREGS (x))->dynenv) +#define SCM_THROW_VALUE(x) ((SCM_CONTREGS (x))->throw_value) +#define SCM_BASE(x) ((SCM_CONTREGS (x))->base) +#define SCM_SEQ(x) ((SCM_CONTREGS (x))->seq) +#define SCM_DFRAME(x) ((SCM_CONTREGS (x))->dframe) diff --git a/libguile/init.c b/libguile/init.c index 038277dd5..ea7113fe1 100644 --- a/libguile/init.c +++ b/libguile/init.c @@ -175,8 +175,8 @@ start_stack (void *base) /* Create an object to hold the root continuation. */ SCM_NEWCELL (scm_rootcont); - SCM_SETJMPBUF (scm_rootcont, scm_must_malloc ((long) sizeof (scm_contregs), - "continuation")); + SCM_SET_CONTREGS (scm_rootcont, scm_must_malloc (sizeof (scm_contregs), + "continuation")); SCM_SETCAR (scm_rootcont, scm_tc7_contin); SCM_SEQ (scm_rootcont) = 0; /* The root continuation if further initialized by restart_stack. */ diff --git a/libguile/root.c b/libguile/root.c index 4767527fd..ebfdf2c32 100644 --- a/libguile/root.c +++ b/libguile/root.c @@ -253,7 +253,7 @@ scm_internal_cwdr (scm_catch_body_t body, void *body_data, SCM_STACKITEM *stack_start) { #ifdef USE_STACKJMPBUF - scm_contregs static_jmpbuf; + scm_contregs static_contregs; #endif int old_ints_disabled = scm_ints_disabled; SCM old_rootcont, old_winds; @@ -266,11 +266,11 @@ scm_internal_cwdr (scm_catch_body_t body, void *body_data, SCM_NEWCELL (new_rootcont); SCM_REDEFER_INTS; #ifdef USE_STACKJMPBUF - SCM_SETJMPBUF (new_rootcont, &static_jmpbuf); + SCM_SET_CONTREGS (new_rootcont, &static_contregs); #else - SCM_SETJMPBUF (new_rootcont, - scm_must_malloc ((long) sizeof (scm_contregs), - "inferior root continuation")); + SCM_SET_CONTREGS (new_rootcont, + scm_must_malloc (sizeof (scm_contregs), + "inferior root continuation")); #endif SCM_SETCAR (new_rootcont, scm_tc7_contin); SCM_DYNENV (new_rootcont) = SCM_EOL; @@ -303,7 +303,7 @@ scm_internal_cwdr (scm_catch_body_t body, void *body_data, scm_dowinds (old_winds, - scm_ilength (old_winds)); SCM_REDEFER_INTS; #ifdef USE_STACKCJMPBUF - SCM_SETJMPBUF (scm_rootcont, NULL); + SCM_SET_CONTREGS (scm_rootcont, NULL); #endif #ifdef DEBUG_EXTENSIONS scm_last_debug_frame = SCM_DFRAME (old_rootcont); |