<short summary of the patch>
authorCamm Maguire <camm@debian.org>
Sun, 13 Nov 2022 12:55:14 +0000 (12:55 +0000)
committerCamm Maguire <camm@debian.org>
Sun, 13 Nov 2022 12:55:14 +0000 (12:55 +0000)
TODO: Put a short summary on the line above and replace this paragraph
with a longer explanation of this change. Complete the meta-information
with other relevant fields (see below for details). To make it easier, the
information below has been extracted from the changelog. Adjust it or drop
it.

gcl (2.6.12-52) unstable; urgency=medium

  * list_order.8

Gbp-Pq: Name list_order.9

o/gbc.c
o/sgbc.c

diff --git a/o/gbc.c b/o/gbc.c
index 8dbd724dd1a1af9207edb2a4057a4d08e0095d2d..0f1507f46fd6acd93c78992b38ce3d141d87f05c 100755 (executable)
--- a/o/gbc.c
+++ b/o/gbc.c
@@ -959,7 +959,7 @@ mark_c_stack(jmp_buf env1, int n, void (*fn)(void *,void *,int)) {
 static void
 sweep_phase(void) {
 
-  STATIC long j, k;
+  STATIC long j, k, l;
   STATIC object x;
   STATIC char *p;
   STATIC struct typemanager *tm;
@@ -977,26 +977,28 @@ sweep_phase(void) {
     
     p = pagetochar(page(v));
     f = FREELIST_TAIL(tm);
-    k = 0;
+    l = k = 0;
     for (j = tm->tm_nppage; j > 0; --j, p += tm->tm_size) {
       x = (object)p;
 
       if (is_marked(x)) {
        unmark(x);
+       l++;
        continue;
       }
 
+      k++;
+
       make_free(x);
       SET_LINK(f,x);
       f = x;
-      k++;
 
     }
 
     SET_LINK(f,OBJNULL);
     tm->tm_tail = f;
     tm->tm_nfree += k;
-    pagetoinfo(page(v))->in_use=tm->tm_nppage-k;
+    pagetoinfo(page(v))->in_use=l;
     
   }
 
index b59a5cc14a17fc8a2d3408ac776048dcaa48b71f..4927e282e25b5d3d2594b8ebc525fa1c4a16e3b3 100755 (executable)
--- a/o/sgbc.c
+++ b/o/sgbc.c
@@ -152,7 +152,7 @@ sgc_mark_phase(void) {
 
 static void
 sgc_sweep_phase(void) {
-  STATIC long j, k;
+  STATIC long j, k, l;
   STATIC object x;
   STATIC char *p;
   STATIC struct typemanager *tm;
@@ -160,13 +160,18 @@ sgc_sweep_phase(void) {
   int size;
   STATIC struct pageinfo *v;
   
+  for (j= t_start; j < t_contiguous ; j++) {
+    tm_of(j)->tm_free=OBJNULL;
+    tm_of(j)->tm_nfree=0;
+  }
+
   for (v=cell_list_head;v;v=v->next) {
 
     tm = tm_of((enum type)v->type);
     
     p = pagetochar(page(v));
     f = FREELIST_TAIL(tm);
-    k = 0;
+    l = k = 0;
     size=tm->tm_size;
 
     if (v->sgc_flags&SGC_PAGE_FLAG) {
@@ -175,10 +180,9 @@ sgc_sweep_phase(void) {
 
        x = (object)p;
        
-       if (is_free(x))
-         continue;
-       else if (is_marked(x)) {
+       if (is_marked(x)) {
          unmark(x);
+         l++;
          continue;
        }
 
@@ -187,26 +191,26 @@ sgc_sweep_phase(void) {
          continue;
 #endif
        
-       /* it is ok to free x */
-       
-       SET_LINK(f,x);
+       k++;
        make_free(x);
+       SET_LINK(f,x);
+       f = x;
+
 #ifndef SGC_WHOLE_PAGE
        if (TYPEWORD_TYPE_P(v->type)) x->d.s = SGC_RECENT;
 #endif
-       f = x;
-       k++;
 
       }
+
       SET_LINK(f,OBJNULL);
       tm->tm_tail = f;
       tm->tm_nfree += k;
-      v->in_use-=k;
+      v->in_use=l;
 
     } else if (WRITABLE_PAGE_P(page(v))) /*non sgc_page */
       for (j = tm->tm_nppage; --j >= 0;  p += size) {
        x = (object)p;
-       if (is_marked(x) && !is_free(x)) {
+       if (is_marked(x)) {
          unmark(x);
        }
       }