[uim-commit] r2216 - branches/r5rs/sigscheme
yamaken at freedesktop.org
yamaken at freedesktop.org
Tue Nov 22 00:37:15 PST 2005
Author: yamaken
Date: 2005-11-22 00:36:53 -0800 (Tue, 22 Nov 2005)
New Revision: 2216
Modified:
branches/r5rs/sigscheme/sigschemeinternal.h
branches/r5rs/sigscheme/storage-continuation.c
branches/r5rs/sigscheme/storage-gc.c
Log:
* sigscheme/sigschemeinternal.h
* sigscheme/storage-continuation.c
* sigscheme/storage-gc.c
- Revert r2199 since the object marking is also implicitly performed
by stack scanning
Modified: branches/r5rs/sigscheme/sigschemeinternal.h
===================================================================
--- branches/r5rs/sigscheme/sigschemeinternal.h 2005-11-22 08:02:55 UTC (rev 2215)
+++ branches/r5rs/sigscheme/sigschemeinternal.h 2005-11-22 08:36:53 UTC (rev 2216)
@@ -337,12 +337,10 @@
void SigScm_InitGC(void);
void SigScm_FinalizeGC(void);
ScmObj SigScm_NewObjFromHeap(void);
-void Scm_MarkObj(ScmObj obj);
/* storage-continuation.c */
void SigScm_InitContinuation(void);
void SigScm_FinalizeContinuation(void);
-void Scm_MarkContinuation(ScmObj cont);
void Scm_DestructContinuation(ScmObj cont);
ScmObj Scm_CallWithCurrentContinuation(ScmObj proc, ScmEvalState *eval_state);
void Scm_CallContinuation(ScmObj cont, ScmObj ret);
Modified: branches/r5rs/sigscheme/storage-continuation.c
===================================================================
--- branches/r5rs/sigscheme/storage-continuation.c 2005-11-22 08:02:55 UTC (rev 2215)
+++ branches/r5rs/sigscheme/storage-continuation.c 2005-11-22 08:36:53 UTC (rev 2216)
@@ -245,15 +245,6 @@
return dest_cont;
}
-void Scm_MarkContinuation(ScmObj cont)
-{
- struct continuation_frame *frame;
-
- frame = CONTINUATION_FRAME(cont);
- if (frame != INVALID_CONTINUATION_OPAQUE)
- Scm_MarkObj(frame->dyn_ext);
-}
-
void Scm_DestructContinuation(ScmObj cont)
{
/* no object to free(3) in this implementation */
Modified: branches/r5rs/sigscheme/storage-gc.c
===================================================================
--- branches/r5rs/sigscheme/storage-gc.c 2005-11-22 08:02:55 UTC (rev 2215)
+++ branches/r5rs/sigscheme/storage-gc.c 2005-11-22 08:36:53 UTC (rev 2216)
@@ -155,6 +155,7 @@
static void gc_mark_and_sweep(void);
/* GC Mark Related Functions */
+static void mark_obj(ScmObj obj);
static int is_pointer_to_heap(ScmObj obj);
static void gc_mark_protected_var();
@@ -390,7 +391,7 @@
}
}
-void Scm_MarkObj(ScmObj obj)
+static void mark_obj(ScmObj obj)
{
int i = 0;
@@ -409,24 +410,24 @@
/* mark recursively */
switch (SCM_TYPE(obj)) {
case ScmCons:
- Scm_MarkObj(CAR(obj));
+ mark_obj(CAR(obj));
obj = CDR(obj);
goto mark_loop;
break;
case ScmSymbol:
- Scm_MarkObj(SCM_SYMBOL_VCELL(obj));
+ mark_obj(SCM_SYMBOL_VCELL(obj));
break;
case ScmClosure:
- Scm_MarkObj(SCM_CLOSURE_EXP(obj));
+ mark_obj(SCM_CLOSURE_EXP(obj));
obj = SCM_CLOSURE_ENV(obj);
goto mark_loop;
break;
case ScmValuePacket:
#if SCM_USE_VALUECONS
- Scm_MarkObj(SCM_VALUECONS_CAR(obj));
+ mark_obj(SCM_VALUECONS_CAR(obj));
obj = SCM_VALUECONS_CDR(obj);
#else
obj = SCM_VALUEPACKET_VALUES(obj);
@@ -435,21 +436,10 @@
case ScmVector:
for (i = 0; i < SCM_VECTOR_LEN(obj); i++) {
- Scm_MarkObj(SCM_VECTOR_VEC(obj)[i]);
+ mark_obj(SCM_VECTOR_VEC(obj)[i]);
}
break;
- case ScmContinuation:
- /*
- * Since continuation object is not so many, marking the object by
- * function call will not cost high. This function interface makes
- * continuation module substitution easy without preparing
- * module-specific header file which contains the module-specific
- * mark macro.
- */
- Scm_MarkContinuation(obj);
- break;
-
default:
break;
}
@@ -488,7 +478,7 @@
{
gc_protected_var *item = NULL;
for (item = protected_var_list; item; item = item->next_var) {
- Scm_MarkObj(*item->var);
+ mark_obj(*item->var);
}
}
@@ -502,7 +492,7 @@
obj = start[i];
if (is_pointer_to_heap(obj)) {
- Scm_MarkObj(obj);
+ mark_obj(obj);
}
}
@@ -532,7 +522,7 @@
{
int i = 0;
for (i = 0; i < NAMEHASH_SIZE; i++) {
- Scm_MarkObj(scm_symbol_hash[i]);
+ mark_obj(scm_symbol_hash[i]);
}
}
More information about the uim-commit
mailing list