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

  * Version_2_6_13pre13

Gbp-Pq: Name Version_2_6_13pre13

h/protoize.h
o/alloc.c
o/gbc.c

index 6664f89a08269520ae3c02af822f15a8f4c5a74e..37f058f0c47c033acdf93dff8f53f47735c71396 100644 (file)
@@ -1918,7 +1918,7 @@ void
 allocate_code_block_reserve(void);
 
 void *
-alloc_contblock_no_gc(size_t);
+alloc_contblock_no_gc(size_t,char *);
 
 void
 reset_contblock_freelist(void);
index 5d6fd8c06378cd2c29d078f8d6b0d6ee1de116ad..7aaa03b02e2f51e6f4f4818a62f6d885f88589d4 100644 (file)
--- a/o/alloc.c
+++ b/o/alloc.c
@@ -1047,7 +1047,7 @@ alloc_contblock(size_t n) {
 }
 
 void *
-alloc_contblock_no_gc(size_t n) {
+alloc_contblock_no_gc(size_t n,char *limit) {
 
   struct typemanager *tm=tm_of(t_contiguous);
   void *p;
@@ -1057,7 +1057,7 @@ alloc_contblock_no_gc(size_t n) {
   if ((p=alloc_from_freelist(tm,n)))
     return p;
 
-  if (tpage(tm,n)<(rb_start-heap_end)>>PAGEWIDTH && (p=alloc_after_adding_pages(tm,n)))
+  if (tpage(tm,n)<(limit-heap_end)>>PAGEWIDTH && (p=alloc_after_adding_pages(tm,n)))
     return p;
 
   return NULL;
diff --git a/o/gbc.c b/o/gbc.c
index eb56687f95bf2a72d772318f210e1becc5acb8f5..7b58e6c84309c61d7c42ea170a7b27372fd6b8b5 100755 (executable)
--- a/o/gbc.c
+++ b/o/gbc.c
@@ -431,29 +431,21 @@ collecting(void *p) {
 
 static ufixnum ngc_thresh;
 static union {struct dummy d;ufixnum f;} rst={.f=-1};
-/* static object lcv=Cnil; */
+static void *static_promotion_limit;
 
 static inline void
 mark_leaf_data(object x,void **pp,ufixnum s,ufixnum r) {
 
-  void *p=*pp,*dp/* ,*dpe */;
+  void *p=*pp,*dp;
   
   if (!marking(p)||!collecting(p))
     return;
 
-  /* if (lcv!=Cnil && !collecting(lcv->st.st_self) && */
-  /*     (dp=PCEI(lcv->st.st_self,r)) && dp+s<=(dpe=lcv->st.st_self+lcv->st.st_dim) */
-  /*     && x && x->d.st>=ngc_thresh) { */
-
   if (what_to_collect!=t_contiguous && 
       x && x->d.st>=ngc_thresh &&
-      (dp=alloc_contblock_no_gc(s))) {
+      (dp=alloc_contblock_no_gc(s,static_promotion_limit))) {
     
-    /* fprintf(stderr,"Promoting %p,%lu to %p\n",p,s,dp); */
-    /* fflush(stderr); */
-
     *pp=memcpy(dp,p,s);
-    /* lcv->st.st_fillp=lcv->st.st_dim=(dpe-(void *)(lcv->st.st_self=dp+s)); */
     x->d.st=0;
 
     return;
@@ -1204,8 +1196,10 @@ GBC(enum type t) {
 
   if (gc_time >=0 && !gc_recursive++) {gc_start=runtime();}
   
-  if (COLLECT_RELBLOCK_P)
+  if (COLLECT_RELBLOCK_P) {
+    static_promotion_limit=rb_start<new_rb_start ? rb_start : new_rb_start;/*do not allow static promotion to go past this point*/
     setup_rb();
+  }
   
 #ifdef DEBUG
   if (debug) {