From f9b8df7d2237da3f443d5df31cb68ce43ae28bd1 Mon Sep 17 00:00:00 2001 From: Camm Maguire Date: Sun, 13 Nov 2022 12:55:14 +0000 Subject: [PATCH] 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-6) unstable; urgency=medium * Version_2_6_13pre5 Gbp-Pq: Name Version_2_6_13pre6 --- o/alloc.c | 23 ++++++++++++++++------- o/gbc.c | 18 ++++++++---------- 2 files changed, 24 insertions(+), 17 deletions(-) diff --git a/o/alloc.c b/o/alloc.c index 38b97ba..d738ab7 100644 --- a/o/alloc.c +++ b/o/alloc.c @@ -254,8 +254,10 @@ empty_relblock(void) { object o=sSAleaf_collection_thresholdA->s.s_dbind; sSAleaf_collection_thresholdA->s.s_dbind=make_fixnum(0); - for (;rb_pointer!=rb_start&&rb_pointer!=rb_end;) + for (;rb_pointer!=rb_start&&rb_pointer!=rb_end;) { + tm_table[t_relocatable].tm_adjgbccnt--; GBC(t_relocatable); + } sSAleaf_collection_thresholdA->s.s_dbind=o; } @@ -498,10 +500,10 @@ static int rebalance_maxpages(struct typemanager *my_tm,fixnum z) { fixnum d; - ufixnum i,j; + ufixnum i,j,r=(my_tm->tm_type==t_relocatable ? 2 : 1); - d=(z-my_tm->tm_maxpage)*(my_tm->tm_type==t_relocatable ? 2 : 1); + d=(z-my_tm->tm_maxpage)*r; j=sum_maxpages(); if (j+d>phys_pages) { @@ -517,14 +519,14 @@ rebalance_maxpages(struct typemanager *my_tm,fixnum z) { if (e+phys_pages-j<=0) return 0; - f=1.0-(double)e/k; + f=k ? 1.0-(double)e/k : 1.0; for (i=t_start;itm_maxpage+(phys_pages-sum_maxpages()))/(my_tm->tm_type==t_relocatable ? 2 : 1))); + massert(set_tm_maxpage(my_tm,(my_tm->tm_maxpage*r+(phys_pages-sum_maxpages()))/r)); return 1; @@ -624,7 +626,12 @@ expand_contblock_index_space(void) { if (cbv->v.v_fillp+1==cbv->v.v_dim) { - void *v=alloc_relblock(2*cbv->v.v_dim*sizeof(fixnum)); + void *v; + object o=sSAleaf_collection_thresholdA->s.s_dbind; + + sSAleaf_collection_thresholdA->s.s_dbind=make_fixnum(-1); + v=alloc_relblock(2*cbv->v.v_dim*sizeof(fixnum)); + sSAleaf_collection_thresholdA->s.s_dbind=o; memcpy(v,cbv->v.v_self,cbv->v.v_dim*sizeof(fixnum)); cbv->v.v_self=v; @@ -731,13 +738,14 @@ insert_contblock(void *p,ufixnum s) { cbp->cb_size=s; cbp->cb_link=*cbpp; - *cbpp=cbp; if ((!cbp->cb_link || cbp->cb_link->cb_size!=s)) { cbppp=expand_contblock_index(cbppp); cbppp[1]=&cbp->cb_link; } + *cbpp=cbp; + } static inline void @@ -890,6 +898,7 @@ add_pages(struct typemanager *tm,fixnum m) { if (rb_pointer>rb_end) { fprintf(stderr,"Moving relblock low before expanding relblock pages\n"); fflush(stderr); + tm_table[t_relocatable].tm_adjgbccnt--; GBC(t_relocatable); } nrbpage+=m; diff --git a/o/gbc.c b/o/gbc.c index bca86cd..3e7d6ae 100755 --- a/o/gbc.c +++ b/o/gbc.c @@ -1042,14 +1042,10 @@ contblock_sweep_phase(void) { struct pageinfo *v; STATIC char *s, *e, *p, *q; - object o; ufixnum i; reset_contblock_freelist(); - o=sSAleaf_collection_thresholdA->s.s_dbind; - sSAleaf_collection_thresholdA->s.s_dbind=make_fixnum(-1); - for (i=0;iv.v_fillp && (v=(void *)contblock_array->v.v_self[i]);i++) { bool z; @@ -1074,8 +1070,6 @@ contblock_sweep_phase(void) { } - sSAleaf_collection_thresholdA->s.s_dbind=o; - sweep_link_array(); } @@ -1646,14 +1640,18 @@ DEFUN_NEW("GBC",object,fSgbc,SI,1,1,NONE,OO,OO,OO,OO,(object x0),"") { /* 1 args */ - if (x0 == Ct) + if (x0 == Ct) { + tm_table[t_contiguous].tm_adjgbccnt--; GBC(t_other); - else if (x0 == Cnil) + } else if (x0 == Cnil) { + tm_table[t_cons].tm_adjgbccnt--; GBC(t_cons); - else if (eql(small_fixnum(0),x0)) + } else if (eql(small_fixnum(0),x0)) { + tm_table[t_contiguous].tm_adjgbccnt--; GBC(t_contiguous); - else { + } else { x0 = small_fixnum(1); + tm_table[t_relocatable].tm_adjgbccnt--; GBC(t_relocatable); } RETURN1(x0); -- 2.30.2