Blob Blame History Raw
Description: <short summary of the 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-3) unstable; urgency=medium
 .
   * Version_2_6_13pre2
Author: Camm Maguire <camm@debian.org>

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: https://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: <YYYY-MM-DD>

--- gcl-2.6.12.orig/h/protoize.h
+++ gcl-2.6.12/h/protoize.h
@@ -1938,3 +1938,6 @@ check_avail_pages(void);
 
 inline int
 mbrk(void *);
+
+void
+maybe_set_hole_from_maxpages(void);
--- gcl-2.6.12.orig/o/alloc.c
+++ gcl-2.6.12/o/alloc.c
@@ -259,19 +259,15 @@ eg to add 20 more do (si::set-hole-size
 
     holepage -= nn;
     heap_end=v;
-    return e;
 
+  } else if (v>(void *)core_end) {
+    
+    massert(!mbrk(v));
+    core_end=v;
+    
   }
-
-  if (nn<=(core_end-heap_end)/PAGESIZE)
-    return(heap_end);
-
-  if (mbrk(v))
-    error("Can't allocate.  Good-bye!");
-
-  core_end=v;
-
-  return(heap_end);
+  
+  return(e);
 
 }
 
@@ -1177,6 +1173,15 @@ object malloc_list=Cnil;
 #include <signal.h>
 
 void
+maybe_set_hole_from_maxpages(void) {
+  if (rb_start==heap_end && rb_end==rb_start && rb_limit==rb_start && rb_pointer==rb_start) {
+    holepage=new_holepage;
+    alloc_page(-holepage);
+    rb_start=rb_end=rb_limit=rb_pointer=heap_end+(holepage<<PAGEWIDTH);
+  }
+}
+
+void
 gcl_init_alloc(void *cs_start) {
 
   fixnum cssize=(1L<<23);
@@ -1261,11 +1266,7 @@ gcl_init_alloc(void *cs_start) {
   update_real_maxpage();
 
   if (gcl_alloc_initialized) {
-    if (rb_start==heap_end && rb_end==rb_start && rb_limit==rb_start && rb_pointer==rb_start) {
-      holepage=new_holepage;
-      alloc_page(-holepage);
-      rb_start=rb_end=rb_limit=rb_pointer=heap_end+(holepage<<PAGEWIDTH);
-    }
+    maybe_set_hole_from_maxpages();
     return;
   }
   
--- gcl-2.6.12.orig/o/main.c
+++ gcl-2.6.12/o/main.c
@@ -327,6 +327,7 @@ DEFUN_NEW("SET-LOG-MAXPAGE-BOUND",object
     minimize_image();
     log_maxpage_bound=l;
     update_real_maxpage();
+    maybe_set_hole_from_maxpages();
   }
 
   return (object)log_maxpage_bound;
--- gcl-2.6.12.orig/o/symbol.d
+++ gcl-2.6.12/o/symbol.d
@@ -533,8 +533,8 @@ DEFVAR("*GENSYM-COUNTER*",sLgensym_count
 	set_up_string_register("");
 	sym = make_symbol(string_register);
 	{BEGIN_NO_INTERRUPT;	
-	sym->s.s_fillp = i;
 	sym->s.s_self = alloc_relblock(i);
+	sym->s.s_fillp = i;
 	i=this_gensym_prefix->st.st_fillp;
 	for (j = 0;  j < i;  j++)
 		sym->s.s_self[j] = this_gensym_prefix->st.st_self[j];
--- gcl-2.6.12.orig/pcl/makefile
+++ gcl-2.6.12/pcl/makefile
@@ -17,6 +17,7 @@ SETUP='(load "defsys.lisp")' \
 	'(setq compiler::*default-c-file* t)'\
 	'(setq compiler::*default-data-file* t)'\
 	'(setq compiler::*default-system-p* t)' \
+	'(setq si::*code-block-reserve* (make-array 10000000 :element-type (quote character) :static t) a nil)' \
 	'(setq compiler::*keep-gaz* t compiler::*tmp-dir* "")'
 
 all: $(addsuffix .c,$(AFILES)) $(addsuffix .o,$(AFILES))