[uim-commit] r2389 - branches/r5rs/sigscheme

yamaken at freedesktop.org yamaken at freedesktop.org
Tue Dec 6 03:50:43 PST 2005


Author: yamaken
Date: 2005-12-06 03:50:38 -0800 (Tue, 06 Dec 2005)
New Revision: 2389

Modified:
   branches/r5rs/sigscheme/storage-gc.c
Log:
* sigscheme/storage-gc.c
  - (ScmObjHeap): Fix incorrect type representation. ((ScmCell *) !=
    ScmObj) in SCM_OBJ_COMPACT
  - (is_pointer_to_heap):
    * Fix incorrect type representation
    * Add FIXME comments


Modified: branches/r5rs/sigscheme/storage-gc.c
===================================================================
--- branches/r5rs/sigscheme/storage-gc.c	2005-12-06 03:48:12 UTC (rev 2388)
+++ branches/r5rs/sigscheme/storage-gc.c	2005-12-06 11:50:38 UTC (rev 2389)
@@ -95,7 +95,7 @@
 /*=======================================
   File Local Struct Declarations
 =======================================*/
-typedef ScmObj ScmObjHeap;
+typedef ScmCell *ScmObjHeap;
 
 /* Represents C variable that is holding a ScmObj to be protected from GC */
 typedef struct gc_protected_var_ gc_protected_var;
@@ -467,16 +467,18 @@
 /* The core part of Conservative GC */
 static int is_pointer_to_heap(ScmObj obj)
 {
+    ScmCell *head, *ptr;
+    int i;
+
 #if SCM_OBJ_COMPACT
+    /* FIXME: reject immediate objects here for efficiency */
+    /* FIXME: hide internal representation by a GC bit stripping macro */
     /* 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);
+    ptr = (ScmCell *)(((unsigned int)(obj)) & SCM_VALUE_MASK);
 #else
-    ScmObj ptr = obj;
+    ptr = obj;
 #endif
-    ScmObj head = SCM_NULL;
-    int i;
-
     for (i = 0; i < scm_heap_num; i++) {
         if ((head = scm_heaps[i])
             && (head <= ptr)



More information about the uim-commit mailing list