|
|
385abae |
Description: <short summary of the patch>
|
|
|
385abae |
TODO: Put a short summary on the line above and replace this paragraph
|
|
|
385abae |
with a longer explanation of this change. Complete the meta-information
|
|
|
385abae |
with other relevant fields (see below for details). To make it easier, the
|
|
|
385abae |
information below has been extracted from the changelog. Adjust it or drop
|
|
|
385abae |
it.
|
|
|
385abae |
.
|
|
|
385abae |
gcl (2.6.12-2) unstable; urgency=medium
|
|
|
385abae |
.
|
|
|
385abae |
* Version_2_6_13pre1
|
|
|
385abae |
Author: Camm Maguire <camm@debian.org>
|
|
|
385abae |
|
|
|
385abae |
---
|
|
|
385abae |
The information above should follow the Patch Tagging Guidelines, please
|
|
|
385abae |
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
|
|
|
385abae |
are templates for supplementary fields that you might want to add:
|
|
|
385abae |
|
|
|
385abae |
Origin: <vendor|upstream|other>, <url of original patch>
|
|
|
385abae |
Bug: <url in upstream bugtracker>
|
|
|
385abae |
Bug-Debian: https://bugs.debian.org/<bugnumber>
|
|
|
385abae |
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
|
|
|
385abae |
Forwarded: <no|not-needed|url proving that it has been forwarded>
|
|
|
385abae |
Reviewed-By: <name and email of someone who approved the patch>
|
|
|
385abae |
Last-Update: <YYYY-MM-DD>
|
|
|
385abae |
|
|
|
385abae |
--- gcl-2.6.12.orig/h/bsd.h
|
|
|
385abae |
+++ gcl-2.6.12/h/bsd.h
|
|
|
385abae |
@@ -33,39 +33,7 @@ filecpy(save, original, stsize - sizeof(
|
|
|
385abae |
|
|
|
385abae |
extern char etext;
|
|
|
385abae |
|
|
|
385abae |
-
|
|
|
385abae |
-
|
|
|
385abae |
-
|
|
|
385abae |
-/* #define SET_REAL_MAXPAGE do { struct rlimit data_rlimit; \ */
|
|
|
385abae |
-/* extern char etext; \ */
|
|
|
385abae |
-/* real_maxpage = MAXPAGE ; \ */
|
|
|
385abae |
-/* getrlimit(RLIMIT_DATA, &data_rlimit); \ */
|
|
|
385abae |
-/* real_maxpage = ((unsigned int)&etext/PAGESIZE + data_rlimit.rlim_cur/PAGESIZE); \ */
|
|
|
385abae |
-/* if (real_maxpage > MAXPAGE) \ */
|
|
|
385abae |
-/* real_maxpage = MAXPAGE ; } while(0) */
|
|
|
385abae |
-
|
|
|
385abae |
-#define ROUND_UP_SBRK(x) \
|
|
|
385abae |
- do {long i; \
|
|
|
385abae |
- if ((i = ((long)x & (PAGESIZE - 1)))) \
|
|
|
385abae |
- x=sbrk(PAGESIZE - i); } while(0);
|
|
|
385abae |
-
|
|
|
385abae |
-#define FIX_RANDOM_SBRK \
|
|
|
385abae |
-do {char *x=sbrk(0); \
|
|
|
385abae |
- if (core_end != x) \
|
|
|
385abae |
- { ROUND_UP_SBRK(x); x=sbrk(0);\
|
|
|
385abae |
- while (core_end < x) \
|
|
|
385abae |
- { \
|
|
|
385abae |
- core_end = core_end + PAGESIZE;} \
|
|
|
385abae |
- if (core_end !=x) error("Someone allocated my memory");}} while (0)
|
|
|
385abae |
-
|
|
|
385abae |
-
|
|
|
385abae |
-#define INIT_ALLOC \
|
|
|
385abae |
- heap_end = sbrk(0); ROUND_UP_SBRK(heap_end);\
|
|
|
385abae |
- heap_end = core_end = sbrk(0);
|
|
|
385abae |
-
|
|
|
385abae |
-#define IF_ALLOCATE_ERR \
|
|
|
385abae |
- FIX_RANDOM_SBRK; \
|
|
|
385abae |
- if (core_end != sbrk(PAGESIZE*(n - m)))
|
|
|
385abae |
+#define INIT_ALLOC heap_end = core_end = sbrk(0);
|
|
|
385abae |
|
|
|
385abae |
#define SYM_EXTERNAL_P(sym) ((sym)->n_type & N_EXT)
|
|
|
385abae |
|
|
|
385abae |
--- gcl-2.6.12.orig/h/protoize.h
|
|
|
385abae |
+++ gcl-2.6.12/h/protoize.h
|
|
|
385abae |
@@ -1935,3 +1935,6 @@ empty_relblock(void);
|
|
|
385abae |
|
|
|
385abae |
fixnum
|
|
|
385abae |
check_avail_pages(void);
|
|
|
385abae |
+
|
|
|
385abae |
+inline int
|
|
|
385abae |
+mbrk(void *);
|
|
|
385abae |
--- gcl-2.6.12.orig/o/alloc.c
|
|
|
385abae |
+++ gcl-2.6.12/o/alloc.c
|
|
|
385abae |
@@ -223,61 +223,53 @@ resize_hole(ufixnum hp,enum type tp) {
|
|
|
385abae |
inline void *
|
|
|
385abae |
alloc_page(long n) {
|
|
|
385abae |
|
|
|
385abae |
- fixnum d,m;
|
|
|
385abae |
-
|
|
|
385abae |
- if (n>=0) {
|
|
|
385abae |
+ bool s=n<0;
|
|
|
385abae |
+ ufixnum nn=s ? -n : n;
|
|
|
385abae |
+ void *v,*e;
|
|
|
385abae |
+
|
|
|
385abae |
+ if (!s) {
|
|
|
385abae |
|
|
|
385abae |
- if (n>(holepage - (in_signal_handler? 0 :
|
|
|
385abae |
+ if (nn>(holepage - (in_signal_handler? 0 :
|
|
|
385abae |
available_pages-n<=reserve_pages_for_signal_handler ? 0 :
|
|
|
385abae |
reserve_pages_for_signal_handler))) {
|
|
|
385abae |
|
|
|
385abae |
|
|
|
385abae |
- if (in_signal_handler) {
|
|
|
385abae |
- fprintf(stderr,"Cant do relocatable gc in signal handler. \
|
|
|
385abae |
-Try to allocate more space to save for allocation during signals: \
|
|
|
385abae |
-eg to add 20 more do (si::set-hole-size %ld %d)\n...start over ",
|
|
|
385abae |
- new_holepage, 20+ reserve_pages_for_signal_handler); fflush(stderr); exit(1);
|
|
|
385abae |
- }
|
|
|
385abae |
-
|
|
|
385abae |
+ fixnum d=available_pages-nn;
|
|
|
385abae |
|
|
|
385abae |
- d=available_pages-n;
|
|
|
385abae |
d*=0.2;
|
|
|
385abae |
d=d<0.01*real_maxpage ? available_pages-n : d;
|
|
|
385abae |
d=d<0 ? 0 : d;
|
|
|
385abae |
d=new_holepage
|
|
|
385abae |
|
|
|
385abae |
- resize_hole(d+n,t_relocatable);
|
|
|
385abae |
-
|
|
|
385abae |
- }
|
|
|
385abae |
+ if (in_signal_handler)/*FIXME*/
|
|
|
385abae |
+ fprintf(stderr,"Can't do relocatable gc in signal handler. \
|
|
|
385abae |
+Try to allocate more space to save for allocation during signals: \
|
|
|
385abae |
+eg to add 20 more do (si::set-hole-size %ld %d)\n...start over ",
|
|
|
385abae |
+ new_holepage, 20+ reserve_pages_for_signal_handler); fflush(stderr); exit(1);
|
|
|
385abae |
|
|
|
385abae |
- holepage -= n;
|
|
|
385abae |
+ resize_hole(d+nn,t_relocatable);
|
|
|
385abae |
|
|
|
385abae |
- if (heap_end==core_end) {
|
|
|
385abae |
- /* can happen when mallocs occur before rel block set up..*/
|
|
|
385abae |
- sbrk(PAGESIZE*n);
|
|
|
385abae |
- core_end+=PAGESIZE*n;
|
|
|
385abae |
}
|
|
|
385abae |
+ }
|
|
|
385abae |
|
|
|
385abae |
- {
|
|
|
385abae |
- void *e=heap_end;
|
|
|
385abae |
- heap_end+=PAGESIZE*n;
|
|
|
385abae |
+ e=heap_end;
|
|
|
385abae |
+ v=e+nn*PAGESIZE;
|
|
|
385abae |
|
|
|
385abae |
- return(e);
|
|
|
385abae |
- }
|
|
|
385abae |
+ if (!s) {
|
|
|
385abae |
|
|
|
385abae |
- }
|
|
|
385abae |
+ holepage -= nn;
|
|
|
385abae |
+ heap_end=v;
|
|
|
385abae |
+ return e;
|
|
|
385abae |
|
|
|
385abae |
- /* n < 0 , then this says ensure there are -n pages
|
|
|
385abae |
- starting at heap_end, and return pointer to heap_end */
|
|
|
385abae |
- n=-n;
|
|
|
385abae |
- m=(core_end-heap_end)/PAGESIZE;
|
|
|
385abae |
+ }
|
|
|
385abae |
|
|
|
385abae |
- if (n<=m)
|
|
|
385abae |
+ if (nn<=(core_end-heap_end)/PAGESIZE)
|
|
|
385abae |
return(heap_end);
|
|
|
385abae |
|
|
|
385abae |
- IF_ALLOCATE_ERR error("Can't allocate. Good-bye!");
|
|
|
385abae |
+ if (mbrk(v))
|
|
|
385abae |
+ error("Can't allocate. Good-bye!");
|
|
|
385abae |
|
|
|
385abae |
- core_end+=PAGESIZE*(n-m);
|
|
|
385abae |
+ core_end=v;
|
|
|
385abae |
|
|
|
385abae |
return(heap_end);
|
|
|
385abae |
|
|
|
385abae |
@@ -692,7 +684,7 @@ print_cb(int print) {
|
|
|
385abae |
massert(**cbppp==cbp);
|
|
|
385abae |
for (k=0;cbp && cbp->cb_size==(**cbppp)->cb_size;cbpp=&cbp->cb_link,cbp=cbp->cb_link,k++);
|
|
|
385abae |
if (print)
|
|
|
385abae |
- fprintf(stderr,"%lu %p %p %lu %lu\n",cbppp-cbsrch1,*cbppp,**cbppp,(**cbppp)->cb_size,k);
|
|
|
385abae |
+ fprintf(stderr,"%lu %p %p %lu %lu\n",(unsigned long)(cbppp-cbsrch1),*cbppp,**cbppp,(**cbppp)->cb_size,k);
|
|
|
385abae |
}
|
|
|
385abae |
massert(cbppp==cbsrche);
|
|
|
385abae |
massert(*cbppp==cbpp);
|
|
|
385abae |
--- gcl-2.6.12.orig/o/main.c
|
|
|
385abae |
+++ gcl-2.6.12/o/main.c
|
|
|
385abae |
@@ -120,6 +120,7 @@ fixnum log_maxpage_bound=sizeof(fixnum)*
|
|
|
385abae |
|
|
|
385abae |
inline int
|
|
|
385abae |
mbrk(void *v) {
|
|
|
385abae |
+
|
|
|
385abae |
ufixnum uv=(ufixnum)v,uc=(ufixnum)sbrk(0),ux,um;
|
|
|
385abae |
fixnum m=((1UL<<(sizeof(fixnum)*8-1))-1);
|
|
|
385abae |
|
|
|
385abae |
@@ -134,9 +135,12 @@ mbrk(void *v) {
|
|
|
385abae |
um=uc;
|
|
|
385abae |
ux=uv;
|
|
|
385abae |
}
|
|
|
385abae |
+
|
|
|
385abae |
if (((fixnum)(ux-um))<0)
|
|
|
385abae |
return mbrk((void *)uc+(uv
|
|
|
385abae |
+
|
|
|
385abae |
return uc==(ufixnum)sbrk(uv-uc) ? 0 : -1;
|
|
|
385abae |
+
|
|
|
385abae |
}
|
|
|
385abae |
|
|
|
385abae |
#if defined(__CYGWIN__)||defined(__MINGW32__)
|
|
|
385abae |
@@ -451,7 +455,6 @@ main(int argc, char **argv, char **envp)
|
|
|
385abae |
#ifdef NEED_STACK_CHK_GUARD
|
|
|
385abae |
__stack_chk_guard=random_ulong();/*Cannot be safely set inside a function which returns*/
|
|
|
385abae |
#endif
|
|
|
385abae |
- allocate_code_block_reserve();
|
|
|
385abae |
|
|
|
385abae |
}
|
|
|
385abae |
|
|
|
385abae |
--- gcl-2.6.12.orig/o/sfaslelf.c
|
|
|
385abae |
+++ gcl-2.6.12/o/sfaslelf.c
|
|
|
385abae |
@@ -268,20 +268,6 @@ alloc_memory(ul sz) {
|
|
|
385abae |
|
|
|
385abae |
}
|
|
|
385abae |
|
|
|
385abae |
-void
|
|
|
385abae |
-allocate_code_block_reserve(void) {
|
|
|
385abae |
-
|
|
|
385abae |
- const char *s=getenv("GCL_CODESPACE");
|
|
|
385abae |
- ul n;
|
|
|
385abae |
-
|
|
|
385abae |
- if (!s || sscanf(s,"%lu",&n)!=1)
|
|
|
385abae |
- return;
|
|
|
385abae |
-
|
|
|
385abae |
- sSAcode_block_reserveA->s.s_dbind=alloc_simple_string(n);
|
|
|
385abae |
- sSAcode_block_reserveA->s.s_dbind->st.st_self=alloc_memory(n);
|
|
|
385abae |
-
|
|
|
385abae |
-}
|
|
|
385abae |
-
|
|
|
385abae |
static object
|
|
|
385abae |
load_memory(Shdr *sec1,Shdr *sece,void *v1,ul **got,ul **gote) {
|
|
|
385abae |
|