<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-51) unstable; urgency=medium

  * list_order.7

Gbp-Pq: Name list_order.8

o/gbc.c
o/sgbc.c

diff --git a/o/gbc.c b/o/gbc.c
index b5b0c09b6ce9d8d97ad8bf85fa16fe5e187541d0..8dbd724dd1a1af9207edb2a4057a4d08e0095d2d 100755 (executable)
--- a/o/gbc.c
+++ b/o/gbc.c
@@ -966,6 +966,11 @@ sweep_phase(void) {
   STATIC object f;
   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);
@@ -975,22 +980,23 @@ sweep_phase(void) {
     k = 0;
     for (j = tm->tm_nppage; j > 0; --j, p += tm->tm_size) {
       x = (object)p;
-      if (is_free(x))
-       continue;
-      else if (is_marked(x)) {
+
+      if (is_marked(x)) {
        unmark(x);
        continue;
       }
 
-      SET_LINK(f,x);
       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-=k;
+    pagetoinfo(page(v))->in_use=tm->tm_nppage-k;
     
   }
 
index 291fe67300e1c4c946c2ed14adca0c07e2fec9ff..b59a5cc14a17fc8a2d3408ac776048dcaa48b71f 100755 (executable)
--- a/o/sgbc.c
+++ b/o/sgbc.c
@@ -873,6 +873,7 @@ sgc_quit(void) {
        }
       SET_LINK(f,n!=OBJNULL ? n : o);
       tm->tm_tail=f;
+      for (;OBJ_LINK(tm->tm_tail)!=OBJNULL;tm->tm_tail=OBJ_LINK(tm->tm_tail));
       tm->tm_nfree += tm->tm_alt_nfree;
       tm->tm_alt_nfree = 0;
       tm->tm_alt_free = OBJNULL;