[uim-commit] r2385 - branches/r5rs/sigscheme
kzk at freedesktop.org
kzk at freedesktop.org
Mon Dec 5 18:03:10 PST 2005
Author: kzk
Date: 2005-12-05 18:03:06 -0800 (Mon, 05 Dec 2005)
New Revision: 2385
Modified:
branches/r5rs/sigscheme/storage-gc.c
Log:
* sigscheme/storage-gc.c
- (is_pointer_to_heap): when SCM_OBJ_COMPACT is enabled, the pointer
on the stack is 'tagged' to represent its types. So, we need to
ignore the tag to get its real pointer value.
Modified: branches/r5rs/sigscheme/storage-gc.c
===================================================================
--- branches/r5rs/sigscheme/storage-gc.c 2005-12-06 01:29:32 UTC (rev 2384)
+++ branches/r5rs/sigscheme/storage-gc.c 2005-12-06 02:03:06 UTC (rev 2385)
@@ -360,7 +360,7 @@
for (j = 0; j < SCM_HEAP_SIZE; j++) {
SCM_DO_UNMARK(&scm_heaps[i][j]);
}
- }
+ }
#else /* SCM_OBJ_COMPACT */
++scm_cur_marker; /* make everything unmarked */
@@ -466,16 +466,24 @@
protected_var_list = NULL;
}
+/* The core part of Conservative GC */
static int is_pointer_to_heap(ScmObj obj)
{
- /* The core part of Conservative GC */
- int i = 0;
+#if SCM_OBJ_COMPACT
+ /* The pointer on the stack is 'tagged' to represent its types.
+ * So we need to ignore the tag to get its real pointer value. */
+ ScmObj ptr = (ScmObj)(((unsigned int)(obj)) & SCM_VALUE_MASK);
+#else
+ ScmObj ptr = obj;
+#endif
ScmObj head = SCM_NULL;
+ int i;
+
for (i = 0; i < scm_heap_num; i++) {
if ((head = scm_heaps[i])
- && (head <= obj)
- && (obj < head + SCM_HEAP_SIZE)
- && ((((char*)obj - (char*)head) % sizeof(ScmCell)) == 0))
+ && (head <= ptr)
+ && (ptr < head + SCM_HEAP_SIZE)
+ && ((((char*)ptr - (char*)head) % sizeof(ScmCell)) == 0))
return 1;
}
More information about the uim-commit
mailing list