guile-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

guile/guile-core/libguile gc.c


From: Thien-Thi Nguyen
Subject: guile/guile-core/libguile gc.c
Date: Fri, 17 Aug 2001 17:00:37 -0700

CVSROOT:        /cvs
Module name:    guile
Branch:         branch_release-1-6
Changes by:     Thien-Thi Nguyen <address@hidden>       01/08/17 17:00:37

Modified files:
        guile-core/libguile: gc.c 

Log message:
        Fix omission bug: Add `heap_segment' forward decl
        (proto) in the case when either `GUILE_DEBUG' or
        `GUILE_DEBUG_FREELIST' preprocessor symbols are defined.
        
        (map_free_list): Fix typo: Ref `f' correctly.
        
        Thanks to Chris Cramer.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/guile/guile-core/libguile/gc.c.diff?cvsroot=OldCVS&only_with_tag=branch_release-1-6&tr1=1.208.2.1&tr2=1.208.2.2&r1=text&r2=text

Patches:
Index: guile/guile-core/libguile/gc.c
diff -u guile/guile-core/libguile/gc.c:1.211 
guile/guile-core/libguile/gc.c:1.212
--- guile/guile-core/libguile/gc.c:1.211        Thu Jul 26 14:40:17 2001
+++ guile/guile-core/libguile/gc.c      Fri Aug 17 16:45:29 2001
@@ -102,7 +102,7 @@
 
 scm_t_bits scm_tc16_allocated;
 
-/* Set this to != 0 if every cell that is accessed shall be checked: 
+/* Set this to != 0 if every cell that is accessed shall be checked:
  */
 unsigned int scm_debug_cell_accesses_p = 1;
 
@@ -172,7 +172,7 @@
          if (debug_cells_gc_interval)
            {
              static unsigned int counter = 0;
-             
+
              if (counter != 0)
                {
                  --counter;
@@ -528,6 +528,8 @@
 
 #if defined (GUILE_DEBUG) || defined (GUILE_DEBUG_FREELIST)
 
+static long int heap_segment (SCM obj); /* forw decl: non-debugging func */
+
 static void
 map_free_list (scm_t_freelist *master, SCM freelist)
 {
@@ -540,9 +542,9 @@
 
       if (this_seg == -1)
        {
-         fprintf (stderr, 
+         fprintf (stderr,
                   "map_free_list: can't find segment containing cell %lux\n",
-                  (unsigned long int) SCM_UNPACK (cell));
+                  (unsigned long int) SCM_UNPACK (f));
          abort ();
        }
       else if (this_seg != last_seg)
@@ -656,7 +658,7 @@
 }
 #undef FUNC_NAME
 
-#endif
+#endif /* defined (GUILE_DEBUG) || defined (GUILE_DEBUG_FREELIST) */
 
 #ifdef GUILE_DEBUG_FREELIST
 
@@ -1185,7 +1187,7 @@
 #else
   /* go through the usual marking, but not for self-cycles. */
 # define RECURSE(x) do { if ((x) != p) scm_gc_mark (x); } while (0)
-#endif        
+#endif
   ptr = p;
 
 #ifdef MARK_DEPENDENCIES
@@ -1208,7 +1210,7 @@
     return;
 
 gc_mark_nimp:
-  
+
 #ifdef MARK_DEPENDENCIES
   if (SCM_EQ_P (ptr, p))
     return;
@@ -1230,10 +1232,10 @@
 #endif
 
 #ifndef MARK_DEPENDENCIES
-  
+
   if (SCM_GCMARKP (ptr))
     return;
-  
+
   SCM_SETGCMARK (ptr);
 
 #endif
@@ -1275,7 +1277,7 @@
        if (len)
          {
            long x;
-           
+
            for (x = 0; x < len - 2; x += 2, ++struct_data)
              if (fields_desc[x] == 'p')
                RECURSE (SCM_PACK (*struct_data));
@@ -1451,7 +1453,7 @@
           * Thus, no conservative scanning for free cells is necessary, but
           * instead cells of type scm_tc16_allocated have to be scanned
           * conservatively.  This is done in the mark function of the
-          * scm_tc16_allocated smob type.  */ 
+          * scm_tc16_allocated smob type.  */
 #endif
          break;
        case scm_tc16_big:
@@ -1908,7 +1910,7 @@
 
   scm_cells_allocated = (SCM_HEAP_SIZE - scm_gc_cells_collected);
   scm_gc_yield -= scm_cells_allocated;
-  
+
   if (scm_mallocated < m)
     /* The byte count of allocated objects has underflowed.  This is
        probably because you forgot to report the sizes of objects you
@@ -1974,7 +1976,7 @@
   scm_igc (what);
 
   nm = scm_mallocated + size;
-  
+
   if (nm < size)
     /* The byte count of allocated objects has overflowed.  This is
        probably because you forgot to report the correct size of freed
@@ -2130,7 +2132,7 @@
          memory in some of your smob free methods. */
       abort ();
   }
-  
+
   scm_mallocated += size;
 
   if (scm_mallocated > scm_mtrigger)
@@ -2239,7 +2241,7 @@
   /* Find the right place and insert the segment record.
    */
   new_seg_index = 0;
-  while (new_seg_index < scm_n_heap_segs 
+  while (new_seg_index < scm_n_heap_segs
         && SCM_PTR_LE (scm_heap_table[new_seg_index].bounds[0], seg_org))
     new_seg_index++;
 
@@ -2627,7 +2629,7 @@
 {
   SCM handle;
   SCM key = scm_long2num ((long) p);
-  
+
   /* This critical section barrier will be replaced by a mutex. */
   SCM_REDEFER_INTS;
 
@@ -2877,7 +2879,7 @@
    * the execution of the next gc.  Then, guile would keep executing the
    * after-gc-hook over and over again, and would never come to do other
    * things.
-   * 
+   *
    * To overcome this problem, if cell access debugging with additional
    * garbage collections is enabled, the after-gc-hook is never run by the
    * garbage collecter.  When running guile with cell access debugging and the



reply via email to

[Prev in Thread] Current Thread [Next in Thread]