[uim-commit] r2079 - branches/r5rs/sigscheme
kzk at freedesktop.org
kzk at freedesktop.org
Tue Nov 8 03:05:39 PST 2005
Author: kzk
Date: 2005-11-08 03:05:33 -0800 (Tue, 08 Nov 2005)
New Revision: 2079
Modified:
branches/r5rs/sigscheme/debug.c
branches/r5rs/sigscheme/storage-gc.c
Log:
* Now SCM_OBJ_COMPACT passed the building phase.
But not working properly yet.
* storage-gc.c
- Add SCM_OBJ_COMPACT flag. Need to implement gc_preprocess,
sweep_obj, gc_sweep
* debug.c
- (print_ScmObj_internal): not to use SCM_REINTERPRET_CAST for
avoiding build problem. Please fix if there's any proper solution.
Modified: branches/r5rs/sigscheme/debug.c
===================================================================
--- branches/r5rs/sigscheme/debug.c 2005-11-08 10:37:55 UTC (rev 2078)
+++ branches/r5rs/sigscheme/debug.c 2005-11-08 11:05:33 UTC (rev 2079)
@@ -283,8 +283,15 @@
SigScm_PortPrintf(port, "#<c_pointer %p>", SCM_C_POINTER_VALUE(obj));
break;
case ScmCFuncPointer:
+
+ /* FIXME: This is a workaround for SCM_OBJ_COMPACT. Is there any proper solution? */
+#if SCM_OBJ_COMPACT
SigScm_PortPrintf(port, "#<c_func_pointer %p>",
+ SCM_C_FUNCPOINTER_VALUE(obj));
+#else
+ SigScm_PortPrintf(port, "#<c_func_pointer %p>",
SCM_REINTERPRET_CAST(void *, SCM_C_FUNCPOINTER_VALUE(obj)));
+#endif
break;
}
}
Modified: branches/r5rs/sigscheme/storage-gc.c
===================================================================
--- branches/r5rs/sigscheme/storage-gc.c 2005-11-08 10:37:55 UTC (rev 2078)
+++ branches/r5rs/sigscheme/storage-gc.c 2005-11-08 11:05:33 UTC (rev 2079)
@@ -107,6 +107,7 @@
/*=======================================
File Local Macro Declarations
=======================================*/
+#if !SCM_OBJ_COMPACT
#define SCM_UNMARKER 0
#define SCM_INITIAL_MARKER (SCM_UNMARKER + 1)
#define SCM_IS_MARKED(a) (SCM_MARK(a) == scm_cur_marker)
@@ -114,6 +115,7 @@
#define SCM_DO_MARK(a) (SCM_MARK(a) = scm_cur_marker)
#define SCM_DO_UNMARK(a) (SCM_MARK(a) = SCM_UNMARKER)
#define SCM_MARK_CORRUPTED(a) ((unsigned)SCM_MARK(a) > (unsigned)scm_cur_marker)
+#endif /* !SCM_OBJ_COMPACT */
/*=======================================
Variable Declarations
@@ -123,7 +125,9 @@
static ScmObjHeap *scm_heaps = NULL;
static ScmObj scm_freelist = NULL;
+#if !SCM_OBJ_COMPACT
static int scm_cur_marker = SCM_INITIAL_MARKER;
+#endif
static jmp_buf save_regs_buf;
ScmObj *scm_stack_start_pointer = NULL;
@@ -347,6 +351,10 @@
static void gc_preprocess(void)
{
+#if SCM_OBJ_COMPACT
+ /* TODO : Implement Here! */
+ ;
+#else /* SCM_OBJ_COMPACT */
++scm_cur_marker; /* make everything unmarked */
if (scm_cur_marker == SCM_UNMARKER) {
@@ -364,6 +372,7 @@
}
}
}
+#endif /* SCM_OBJ_COMPACT */
}
static void gc_mark_and_sweep(void)
@@ -532,6 +541,10 @@
static void sweep_obj(ScmObj obj)
{
+#if SCM_OBJ_COMPACT
+ /* TODO : Implement Here! */
+ ;
+#else /* SCM_OBJ_COMPACT */
/* if the type has the pointer to free, then free it! */
switch (SCM_TYPE(obj)) {
case ScmInt:
@@ -572,10 +585,15 @@
default:
break;
}
+#endif
}
static void gc_sweep(void)
{
+#if SCM_OBJ_COMPACT
+ /* TODO : Implement Here! */
+ ;
+#else /* SCM_OBJ_COMPACT */
int i = 0;
int j = 0;
int corrected_obj_num = 0;
@@ -604,4 +622,5 @@
CDBG((SCM_DBG_GC, "heap[%d] swept = %d", i, corrected_obj_num));
}
scm_freelist = scm_new_freelist;
+#endif
}
More information about the uim-commit
mailing list