[uim-commit] r2200 - branches/r5rs/sigscheme
yamaken at freedesktop.org
yamaken at freedesktop.org
Mon Nov 21 03:19:02 PST 2005
Author: yamaken
Date: 2005-11-21 03:18:56 -0800 (Mon, 21 Nov 2005)
New Revision: 2200
Modified:
branches/r5rs/sigscheme/storage-continuation.c
Log:
* sigscheme/storage-continuation.c
- (CONTINUATION_JMPENV, CONTINUATION_SET_JMPENV,
CONTINUATION_DYNEXT, CONTINUATION_SET_DYNEXT): Removed
- (struct continuation_frame):
* Rename the member 'env' to 'c_env'
* Change type of c_env jmp_buf * to jmp_buf
- (Scm_MarkContinuation): Fix expired continuation handling
- (Scm_CallWithCurrentContinuation, Scm_CallContinuation): Follow
the above changes
Modified: branches/r5rs/sigscheme/storage-continuation.c
===================================================================
--- branches/r5rs/sigscheme/storage-continuation.c 2005-11-21 09:34:37 UTC (rev 2199)
+++ branches/r5rs/sigscheme/storage-continuation.c 2005-11-21 11:18:56 UTC (rev 2200)
@@ -56,12 +56,7 @@
#define CONTINUATION_FRAME(cont) \
((struct continuation_frame *)SCM_CONTINUATION_OPAQUE(cont))
-#define CONTINUATION_SET_FRAME SCM_CONTINUATION_SET_OPAQUE
-#define CONTINUATION_JMPENV(cont) (CONTINUATION_FRAME(cont)->env)
-#define CONTINUATION_SET_JMPENV(cont, env) (CONTINUATION_JMPENV(cont) = (env))
-#define CONTINUATION_DYNEXT(cont) (CONTINUATION_FRAME(cont)->dyn_ext)
-#define CONTINUATION_SET_DYNEXT(cont, dyn_ext) \
- ((CONTINUATION_DYNEXT(cont)) = (dyn_ext))
+#define CONTINUATION_SET_FRAME SCM_CONTINUATION_SET_OPAQUE
/*=======================================
File Local Type Definitions
@@ -70,7 +65,7 @@
/* to ensure that the struct is even-byte aligned on stack, a ScmObj is
listed first */
ScmObj dyn_ext;
- jmp_buf *env;
+ jmp_buf c_env;
};
/*=======================================
@@ -252,7 +247,11 @@
void Scm_MarkContinuation(ScmObj cont)
{
- Scm_MarkObj(CONTINUATION_DYNEXT(cont));
+ struct continuation_frame *frame;
+
+ frame = CONTINUATION_FRAME(cont);
+ if (frame != INVALID_CONTINUATION_OPAQUE)
+ Scm_MarkObj(frame->dyn_ext);
}
void Scm_DestructContinuation(ScmObj cont)
@@ -262,21 +261,19 @@
ScmObj Scm_CallWithCurrentContinuation(ScmObj proc, ScmEvalState *eval_state)
{
- jmp_buf env;
ScmObj cont = SCM_FALSE;
ScmObj ret = SCM_FALSE;
- struct continuation_frame cont_frame;
ScmObj saved_trace_stack = SCM_FALSE;
+ struct continuation_frame cont_frame;
+ cont_frame.dyn_ext = current_dynamic_extent;
cont = Scm_NewContinuation();
CONTINUATION_SET_FRAME(cont, &cont_frame);
- CONTINUATION_SET_JMPENV(cont, &env);
- CONTINUATION_SET_DYNEXT(cont, current_dynamic_extent);
#if SCM_NESTED_CONTINUATION_ONLY
continuation_stack_push(cont);
#endif
- if (setjmp(env)) {
+ if (setjmp(cont_frame.c_env)) {
/* returned from longjmp */
/*
* Don't refer cont because it may already be invalidated by
@@ -338,7 +335,7 @@
exit_dynamic_extent(frame->dyn_ext);
continuation_thrown_obj = ret;
- longjmp(*frame->env, 1);
+ longjmp(frame->c_env, 1);
/* NOTREACHED */
} else {
ERR("Scm_CallContinuation: called expired continuation");
More information about the uim-commit
mailing list