Blob Blame 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-23) unstable; urgency=medium
 .
   * Version_2_6_13pre28
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/o/alloc.c
+++ gcl-2.6.12/o/alloc.c
@@ -1203,8 +1203,8 @@ object malloc_list=Cnil;
 
 void
 maybe_set_hole_from_maxpages(void) {
-  if (rb_start==heap_end && rb_end==rb_start && rb_limit==rb_start && rb_pointer==rb_start)
-    resize_hole(available_pages/3,t_relocatable,0);
+  if (rb_pointer==rb_begin())
+    resize_hole(ufmin(phys_pages,available_pages/3),t_relocatable,0);
 }
 
 void
@@ -1358,7 +1358,7 @@ gcl_init_alloc(void *cs_start) {
   set_tm_maxpage(tm_table+t_relocatable,1);
   nrbpage=0;
   
-  resize_hole(ufmin(phys_pages,available_pages/3),t_relocatable,0);
+  maybe_set_hole_from_maxpages();
 #ifdef SGC	
   tm_table[(int)t_relocatable].tm_sgc = 50;
 #endif