From: Camm Maguire Date: Sun, 13 Nov 2022 12:55:14 +0000 (+0000) Subject: X-Git-Tag: archive/raspbian/2.7.1-4+rpi1~2^2^2~132 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=33c8f7838aa9c99bc55bcdaf73e6fa4dd243615f;p=gcl27.git 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-8) unstable; urgency=medium * Version_2_6_13pre7 Gbp-Pq: Name Version_2_6_13pre8a --- diff --git a/gcl-tk/comm.c b/gcl-tk/comm.c index 0613390..e29d231 100755 --- a/gcl-tk/comm.c +++ b/gcl-tk/comm.c @@ -66,7 +66,7 @@ fScheck_fd_for_input(fixnum fd,fixnum timeout) { struct connection_state * -setup_connection_state(fd) +setup_connection_state(int fd) { struct connection_state * res; res = (void *)malloc(sizeof(struct connection_state)); bzero(res,sizeof(struct connection_state)); diff --git a/gcl-tk/guis.h b/gcl-tk/guis.h index 6627ae0..2c849f6 100755 --- a/gcl-tk/guis.h +++ b/gcl-tk/guis.h @@ -4,6 +4,10 @@ #include #define NO_PRELINK_UNEXEC_DIVERSION +#define IMMNUM_H +#define GMP_WRAPPERS_H +#define ERROR_H + #include "include.h" #ifdef NeXT diff --git a/gmp4/mpn/x86_64/k8/redc_1.asm b/gmp4/mpn/x86_64/k8/redc_1.asm index 7453898..9327b21 100644 --- a/gmp4/mpn/x86_64/k8/redc_1.asm +++ b/gmp4/mpn/x86_64/k8/redc_1.asm @@ -114,7 +114,7 @@ ifdef(`PIC',` JUMPTABSECT ALIGN(8) -L(tab): JMPENT( L(0m4), L(tab)) +L(tab): JMPENT( L(0), L(tab)) JMPENT( L(1), L(tab)) JMPENT( L(2), L(tab)) JMPENT( L(3), L(tab)) @@ -397,6 +397,7 @@ L(le1): add %r10, (up) ALIGN(16) +L(0): L(0m4): L(lo0): mov (mp,nneg,8), %rax mov nneg, i diff --git a/h/att_ext.h b/h/att_ext.h index 97eae22..e241b7c 100755 --- a/h/att_ext.h +++ b/h/att_ext.h @@ -29,7 +29,7 @@ void *malloc(size_t); void *realloc(void *,size_t); /* void * memalign(size_t,size_t); */ void *alloc_contblock(size_t); -inline void *alloc_relblock(size_t); +void *alloc_relblock(size_t); /* object fSallocate_contiguous_pages(); */ /* object fSallocate_relocatable_pages(); */ @@ -291,9 +291,7 @@ EXTER object sSAsystem_directoryA; #ifdef UNIX EXTER char *kcl_self; #endif -#if !defined(IN_MAIN) || !defined(ATT) EXTER bool raw_image; -#endif char *merge_system_directory(); diff --git a/h/cmpincl1.h b/h/cmpincl1.h index b5cb795..891505a 100755 --- a/h/cmpincl1.h +++ b/h/cmpincl1.h @@ -1,2 +1 @@ -#define EXTER extern #define CMPINCLUDE diff --git a/h/compbas.h b/h/compbas.h index 168f433..4abad80 100755 --- a/h/compbas.h +++ b/h/compbas.h @@ -1,2 +1,12 @@ #include #define _VA_LIST_DEFINED +#ifndef EXTER +#define EXTER extern +#endif +#ifndef INLINE +#if defined(__GNUC__) && __GNUC__ <= 4 +#define INLINE extern inline +#else +#define INLINE inline +#endif +#endif diff --git a/h/error.h b/h/error.h index 276169a..36f459b 100644 --- a/h/error.h +++ b/h/error.h @@ -1,4 +1,7 @@ -#define Icall_error_handler(a_,b_,c_,d_...) \ +#ifndef ERROR_H +#define ERROR_H + +#define Icall_error_handler(a_,b_,c_,d_...) \ Icall_gen_error_handler(Cnil,null_string,a_,b_,c_,##d_) #define Icall_continue_error_handler(a_,b_,c_,d_,e_...) \ Icall_gen_error_handler(Ct,a_,b_,c_,d_,##e_) @@ -8,12 +11,8 @@ extern enum type t_vtype; extern int vtypep_fn(object); extern void Check_type(object *,int (*)(object),object); +#define PFN(a_) INLINE int Join(a_,_fn)(object x) {return a_(x);} -#ifdef IN_MAIN -#define PFN(a_) int Join(a_,_fn)(object x) {return a_(x);} -#else -#define PFN(a_) extern int Join(a_,_fn)(object x); -#endif PFN(integerp) PFN(non_negative_integerp) PFN(rationalp) @@ -201,3 +200,4 @@ object ihs_top_function_name(ihs_ptr h); abort();\ }) +#endif /*ERROR_H*/ diff --git a/h/gmp_wrappers.h b/h/gmp_wrappers.h index c41ecfb..b76f147 100644 --- a/h/gmp_wrappers.h +++ b/h/gmp_wrappers.h @@ -1,12 +1,8 @@ -#ifndef GMP_EXTERN -#define GMP_EXTERN extern -#endif -#ifndef GMP_EXTERN_INLINE -#define GMP_EXTERN_INLINE GMP_EXTERN __inline__ -#endif +#ifndef GMP_WRAPPERS_H +#define GMP_WRAPPERS_H -GMP_EXTERN jmp_buf gmp_jmp; -GMP_EXTERN int jmp_gmp,gmp_relocatable; +EXTER jmp_buf gmp_jmp; +EXTER int jmp_gmp,gmp_relocatable; #define join(a_,b_) a_ ## b_ #define Join(a_,b_) join(a_,b_) @@ -95,7 +91,7 @@ GMP_EXTERN int jmp_gmp,gmp_relocatable; set to -1 otherwise. 20040815 CM*/ #define MEM_GMP_CALL(n_,rt_,a_,s_,b_...) \ - GMP_EXTERN_INLINE Join(RF_,rt_) Join(m,a_)(Join(P,n_)(b_)) { \ + INLINE Join(RF_,rt_) Join(m,a_)(Join(P,n_)(b_)) { \ int j;\ Join(RD_,rt_);\ if (gmp_relocatable) {\ @@ -195,3 +191,5 @@ MEM_GMP_CALL(2,size_t,mpz_sizeinbase,0,mpz_t,int) /*#define __gmpz_realloc m__gmpz_realloc*/ #define __gmpz_size m__gmpz_size #define __gmpz_sizeinbase m__gmpz_sizeinbase + +#endif /*GMP_WRAPPERS_H*/ diff --git a/h/immnum.h b/h/immnum.h index e09f2fa..c1c1ca6 100644 --- a/h/immnum.h +++ b/h/immnum.h @@ -17,10 +17,10 @@ #define iif2(x,y) is_imm_fixnum2(x,y) -EXTER inline fixnum +INLINE fixnum lnabs(fixnum x) {return x<0 ? ~x : x;} -EXTER inline char +INLINE char clz(ufixnum x) { #ifdef HAVE_CLZL return x ? __builtin_clzl(x) : sizeof(x)*8; @@ -29,7 +29,7 @@ clz(ufixnum x) { #endif } -EXTER inline char +INLINE char ctz(ufixnum x) { #ifdef HAVE_CTZL return __builtin_ctzl(x);/*x ? __builtin_clzl(x) : sizeof(x)*8;*/ @@ -38,10 +38,10 @@ ctz(ufixnum x) { #endif } -EXTER inline char +INLINE char fixnum_length(fixnum x) {return sizeof(x)*8-clz(lnabs(x));} -EXTER inline object +INLINE object immnum_length(object x) {return iif(x) ? mif(fixnum_length(fif(x))) : integer_length(x);} @@ -57,7 +57,7 @@ immnum_length(object x) {return iif(x) ? mif(fixnum_length(fif(x))) : integer_le #define POPD 0x3F #endif -EXTER inline char +INLINE char fixnum_popcount(ufixnum x) { x-=POPA&(x>>1); x=(x&POPB)+((x>>2)&POPB); @@ -70,33 +70,33 @@ fixnum_popcount(ufixnum x) { return x&POPD; } -EXTER inline char +INLINE char /* fixnum_count(fixnum x) {return __builtin_popcountl(lnabs(x));} */ fixnum_count(fixnum x) {return fixnum_popcount(lnabs(x));} -EXTER inline object +INLINE object immnum_count(object x) {return iif(x) ? mif(fixnum_count(fif(x))) : integer_count(x);} /*bs=sizeof(long)*8; lb=bs-clz(labs(x));|x*y|=|x|*|y|<2^(lbx+lby)<2^(bs-1); 0 bounded by 2^0, +-1 by 2^1,mpf by 2^(bs-1), which is sign bit protect labs from most negative fix, here all immfix ok*/ -EXTER inline bool +INLINE bool fixnum_mul_safe_abs(fixnum x,fixnum y) {return clz(x)+clz(y)>sizeof(x)*8+1;} -EXTER inline object +INLINE object safe_mul_abs(fixnum x,fixnum y) {return fixnum_mul_safe_abs(x,y) ? make_fixnum(x*y) : fixnum_times(x,y);} -EXTER inline bool +INLINE bool fixnum_mul_safe(fixnum x,fixnum y) {return fixnum_mul_safe_abs(labs(x),labs(y));} -EXTER inline object +INLINE object safe_mul(fixnum x,fixnum y) {return fixnum_mul_safe(x,y) ? make_fixnum(x*y) : fixnum_times(x,y);} -EXTER inline object +INLINE object immnum_times(object x,object y) {return iif2(x,y) ? safe_mul(fif(x),fif(y)) : number_times(x,y);} -EXTER inline object +INLINE object immnum_plus(object x,object y) {return iif2(x,y) ? make_fixnum(fif(x)+fif(y)) : number_plus(x,y);} -EXTER inline object +INLINE object immnum_minus(object x,object y) {return iif2(x,y) ? make_fixnum(fif(x)-fif(y)) : number_minus(x,y);} -EXTER inline object +INLINE object immnum_negate(object x) {return iif(x) ? make_fixnum(-fif(x)) : number_negate(x);} #define BOOLCLR 0 @@ -116,7 +116,7 @@ immnum_negate(object x) {return iif(x) ? make_fixnum(-fif(x)) : number_negate(x) #define BOOLORC1 015 #define BOOLORC2 013 -EXTER inline fixnum +INLINE fixnum fixnum_boole(fixnum op,fixnum x,fixnum y) { switch(op) { case BOOLCLR: return 0; @@ -139,7 +139,7 @@ fixnum_boole(fixnum op,fixnum x,fixnum y) { return 0;/*FIXME error*/ } -EXTER inline object +INLINE object immnum_boole(fixnum o,object x,object y) {return iif2(x,y) ? mif(fixnum_boole(o,fif(x),fif(y))) : log_op2(o,x,y);} #define immnum_bool(o,x,y) immnum_boole(fixint(o),x,y) @@ -156,93 +156,93 @@ immnum_boole(fixnum o,object x,object y) {return iif2(x,y) ? mif(fixnum_boole(o, #define immnum_orc1(x,y) immnum_boole(BOOLORC1,x,y) #define immnum_orc2(x,y) immnum_boole(BOOLORC2,x,y) -EXTER inline fixnum +INLINE fixnum fixnum_div(fixnum x,fixnum y,fixnum d) { fixnum z=x/y; if (d && x!=y*z && (x*d>0 ? y>0 : y<0)) z+=d; return z; } -EXTER inline fixnum +INLINE fixnum fixnum_rem(fixnum x,fixnum y,fixnum d) { fixnum z=x%y; if (d && z && (x*d>0 ? y>0 : y<0)) z+=y; return z; } -EXTER inline object +INLINE object immnum_truncate(object x,object y) {return iif2(x,y)&&y!=make_fixnum(0) ? mif(fixnum_div(fif(x),fif(y),0)) : (intdivrem(x,y,0,&x,NULL),x);} -EXTER inline object +INLINE object immnum_floor(object x,object y) {return iif2(x,y)&&y!=make_fixnum(0) ? mif(fixnum_div(fif(x),fif(y),-1)) : (intdivrem(x,y,-1,&x,NULL),x);} -EXTER inline object +INLINE object immnum_ceiling(object x,object y) {return iif2(x,y)&&y!=make_fixnum(0) ? mif(fixnum_div(fif(x),fif(y),1)) : (intdivrem(x,y,1,&x,NULL),x);} -EXTER inline object +INLINE object immnum_mod(object x,object y) {return iif2(x,y)&&y!=make_fixnum(0) ? mif(fixnum_rem(fif(x),fif(y),-1)) : (intdivrem(x,y,-1,NULL,&y),y);} -EXTER inline object +INLINE object immnum_rem(object x,object y) {return iif2(x,y)&&y!=make_fixnum(0) ? mif(fixnum_rem(fif(x),fif(y),0)) : (intdivrem(x,y,0,NULL,&y),y);} -EXTER inline fixnum +INLINE fixnum fixnum_rshft(fixnum x,fixnum y) { return y>=sizeof(x)*8 ? (x<0 ? -1 : 0) : x>>y; } -EXTER inline object +INLINE object fixnum_lshft(fixnum x,fixnum y) { return clz(labs(x))>y ? make_fixnum(x<);} -EXTER inline bool +INLINE bool immnum_ge(object x,object y) {return immnum_comp(x,y,>=);} -EXTER inline bool +INLINE bool immnum_minusp(object x) {return iif(x) ? ((ufixnum)x)<((ufixnum)make_fixnum(0)) : number_minusp(x);} -EXTER inline bool +INLINE bool immnum_plusp(object x) {return iif(x) ? ((ufixnum)x)>((ufixnum)make_fixnum(0)) : number_plusp(x);} -EXTER inline bool +INLINE bool immnum_zerop(object x) {return iif(x) ? ((ufixnum)x)==((ufixnum)make_fixnum(0)) : number_zerop(x);} -EXTER inline bool +INLINE bool immnum_evenp(object x) {return iif(x) ? !(((ufixnum)x)&0x1) : number_evenp(x);} -EXTER inline bool +INLINE bool immnum_oddp(object x) {return iif(x) ? (((ufixnum)x)&0x1) : number_oddp(x);} -EXTER inline object +INLINE object immnum_signum(object x) { ufixnum ux=(ufixnum)x,uz=((ufixnum)make_fixnum(0)); return iif(x) ? (ux=(ufixnum)y ? x : y) : (number_compare(x,y)>=0?x:y);} -EXTER inline object +INLINE object immnum_min(object x,object y) {return iif2(x,y) ? ((ufixnum)x<=(ufixnum)y ? x : y) : (number_compare(x,y)<=0?x:y);} -EXTER inline bool +INLINE bool immnum_logt(object x,object y) {return iif2(x,y) ? fixnum_boole(BOOLAND,fif(x),fif(y))!=0 : !number_zerop(log_op2(BOOLAND,x,y));} -EXTER inline fixnum +INLINE fixnum fixnum_gcd(fixnum x,fixnum y) { fixnum t; @@ -343,16 +343,16 @@ fixnum_gcd(fixnum x,fixnum y) { } -EXTER inline object +INLINE object immnum_gcd(object x,object y) {return iif2(x,y) ? mif(fixnum_gcd(labs(fif(x)),labs(fif(y)))) : get_gcd(x,y);} -EXTER inline object +INLINE object fixnum_lcm(fixnum x,fixnum y) { fixnum g=fixnum_gcd(x,y); return g ? safe_mul_abs(x,fixnum_div(y,g,0)) : make_fixnum(0); } -EXTER inline object +INLINE object immnum_lcm(object x,object y) {return iif2(x,y) ? fixnum_lcm(labs(fif(x)),labs(fif(y))) : get_lcm(x,y);} #endif diff --git a/h/include.h b/h/include.h index a28a61e..400c735 100755 --- a/h/include.h +++ b/h/include.h @@ -87,12 +87,6 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. #define isalphanum(x) isalnum(x) #endif -#ifdef IN_MAIN -#define EXTER -#else -#define EXTER extern -#endif - #if defined(GMP) || defined(NEED_MP_H) #include "../h/mp.h" #endif diff --git a/h/notcomp.h b/h/notcomp.h index 3b5bc74..f7e4bc8 100755 --- a/h/notcomp.h +++ b/h/notcomp.h @@ -28,10 +28,7 @@ EXTER long real_maxpage; char *getenv(); EXTER char *this_lisp; -#ifndef IN_MAIN -EXTER -char stdin_buf[], stdout_buf[]; -#endif +EXTER char stdin_buf[],stdout_buf[]; EXTER object user_package; diff --git a/h/page.h b/h/page.h index 477e5e2..6a63747 100755 --- a/h/page.h +++ b/h/page.h @@ -106,7 +106,7 @@ extern fixnum writable_pages; EXTER long first_data_page,real_maxpage,phys_pages,available_pages; EXTER void *data_start,*initial_sbrk; -#if !defined(IN_MAIN) && defined(SGC) +#if defined(SGC) #include "writable.h" #endif diff --git a/h/protoize.h b/h/protoize.h index ed4ceda..b5057e6 100644 --- a/h/protoize.h +++ b/h/protoize.h @@ -1,13 +1,12 @@ /* alloc.c:89:OF */ extern void *alloc_page (long n); /* (n) int n; */ -/* alloc.c:149:OF */ inline void add_page_to_freelist (char *p, struct typemanager *tm); /* (p, tm) char *p; struct typemanager *tm; */ /* alloc.c:196:OF */ extern object type_name (int t); /* (t) int t; */ -/* alloc.c:213:OF */ inline object alloc_object (enum type t); /* (t) enum type t; */ -/* alloc.c:213:OF */ inline void add_pages(struct typemanager *,fixnum); -/* alloc.c:296:OF */ extern inline object make_cons (object a, object d); /* (a, d) object a; object d; */ +/* alloc.c:213:OF */ object alloc_object (enum type t); /* (t) enum type t; */ +/* alloc.c:213:OF */ void add_pages(struct typemanager *,fixnum); +/* alloc.c:296:OF */ extern object make_cons (object a, object d); /* (a, d) object a; object d; */ /* alloc.c:364:OF */ extern object on_stack_cons (object x, object y); /* (x, y) object x; object y; */ /* alloc.c:376:OF */ extern object fSallocated (object typ); /* (typ) object typ; */ /* alloc.c:401:OF */ extern object fSreset_number_used (object typ); /* (typ) object typ; */ -/* alloc.c:480:OF */ extern inline void insert_contblock (void *p, ufixnum s); /* (p, s) char *p; int s; */ +/* alloc.c:480:OF */ extern void insert_contblock (void *p, ufixnum s); /* (p, s) char *p; int s; */ /* alloc.c:480:OF */ extern void insert_maybe_sgc_contblock (char *p, int s); /* (p, s) char *p; int s; */ /* alloc.c:611:OF */ extern void set_maxpage (void); /* () */ /* alloc.c:635:OF */ extern void gcl_init_alloc (void *); /* () */ @@ -1841,43 +1840,40 @@ struct htent *gethash(object,object); int update_real_maxpage(void); -inline fixnum +fixnum set_tm_maxpage(struct typemanager *,fixnum); void init_gmp_rnd_state(__gmp_randstate_struct *); -inline void -set_sgc_bit(struct pageinfo *,void *); - void reinit_gmp(void); object mod(object,object); -inline void +void intdivrem(object,object,fixnum,object *,object *); -inline object +object integer_count(object); -inline object +object integer_length(object); -inline bool +bool integer_bitp(object,object); -inline object +object fixnum_times(fixnum,fixnum); -inline object +object log_op2(fixnum,object,object); -inline object +object fixnum_big_shift(fixnum,fixnum); -inline object +object integer_shift(object,object); object @@ -1921,22 +1917,19 @@ sigint(void); void allocate_code_block_reserve(void); -inline void -resize_hole(ufixnum,enum type); - -inline void * +void * alloc_contblock_no_gc(size_t); -inline void +void reset_contblock_freelist(void); -inline void +void empty_relblock(void); fixnum check_avail_pages(void); -inline int +int mbrk(void *); void @@ -1948,5 +1941,8 @@ alloc_code_space(size_t); object fSmake_vector1_2(fixnum,fixnum,object,object); -inline struct pageinfo * +struct pageinfo * get_pageinfo(void *); + +void +add_page_to_freelist(char *, struct typemanager *); diff --git a/h/writable.h b/h/writable.h index 5f17c74..1149fa3 100644 --- a/h/writable.h +++ b/h/writable.h @@ -1,7 +1,7 @@ EXTER fixnum last_page; EXTER int last_result; -EXTER inline int +INLINE int set_writable(fixnum i,bool m) { fixnum j; @@ -32,7 +32,7 @@ set_writable(fixnum i,bool m) { } -EXTER inline int +INLINE int is_writable(fixnum i) { fixnum j; @@ -51,7 +51,7 @@ is_writable(fixnum i) { } -EXTER inline int +INLINE int is_writable_cached(fixnum i) { if (last_page==i) diff --git a/makefile b/makefile index e724b61..69bfb9f 100644 --- a/makefile +++ b/makefile @@ -265,7 +265,7 @@ $(HDIR)new_decl.h: $(HDIR)mcompdefs.h: $(HDIR)compdefs.h $(HDIR)new_decl.h $(AWK) 'BEGIN {print "#include \"include.h\"";print "#include \"cmponly.h\"";print "---"} {a=$$1;gsub("\\.\\.\\.","",a);print "\"#define " $$1 "\" " a}' $< |\ - $(CC) -E -I./$(HDIR) - |\ + $(CC) -E -P -I./$(HDIR) - |\ $(AWK) '/^\-\-\-$$/ {i=1;next} {if (!i) next} {gsub("\"","");print}' >$@ $(HDIR)cmpinclude.h: $(HDIR)mcompdefs.h $(CMPINCLUDE_FILES) $(HDIR)config.h diff --git a/o/alloc.c b/o/alloc.c index d738ab7..720571a 100644 --- a/o/alloc.c +++ b/o/alloc.c @@ -134,7 +134,7 @@ acomp(const void *v1,const void *v2) { } -inline struct pageinfo * +struct pageinfo * get_pageinfo(void *x) { struct pageinfo **pp=bsearchleq(&x,contblock_array->v.v_self,contblock_array->v.v_fillp,sizeof(*contblock_array->v.v_self),acomp); @@ -144,7 +144,7 @@ get_pageinfo(void *x) { } -inline void +static inline void add_page_to_contblock_list(void *p,fixnum m) { struct pageinfo *pp=pageinfo(p); @@ -176,7 +176,70 @@ icomp(const void *v1,const void *v2) { return *f1<*f2 ? -1 : *f1==*f2 ? 0 : +1; } -inline void + +void +add_page_to_freelist(char *p, struct typemanager *tm) { + + short t,size; + long i=tm->tm_nppage,fw; + object x,f; + struct pageinfo *pp; + + t=tm->tm_type; + + size=tm->tm_size; + f=tm->tm_free; + pp=pageinfo(p); + bzero(pp,sizeof(*pp)); + pp->type=t; + pp->magic=PAGE_MAGIC; + + if (cell_list_head==NULL) + cell_list_tail=cell_list_head=pp; + else if (pp > cell_list_tail) { + cell_list_tail->next=pp; + cell_list_tail=pp; + } + + x= (object)pagetochar(page(p)); + /* set_type_of(x,t); */ + make_free(x); + +#ifdef SGC + + if (sgc_enabled && tm->tm_sgc) + pp->sgc_flags=SGC_PAGE_FLAG; + +#ifndef SGC_WHOLE_PAGE + if (TYPEWORD_TYPE_P(pp->type)) + x->d.s=(sgc_enabled && tm->tm_sgc) ? SGC_RECENT : SGC_NORMAL; +#endif + + /* array headers must be always writable, since a write to the + body does not touch the header. It may be desirable if there + are many arrays in a system to make the headers not writable, + but just SGC_TOUCH the header each time you write to it. this + is what is done with t_structure */ + if (t==(tm_of(t_array)->tm_type)) + pp->sgc_flags|=SGC_PERM_WRITABLE; + +#endif + + fw= *(fixnum *)x; + while (--i >= 0) { + *(fixnum *)x=fw; + SET_LINK(x,f); + f=x; + x= (object) ((char *)x + size); + } + + tm->tm_free=f; + tm->tm_nfree += tm->tm_nppage; + tm->tm_npage++; + +} + +static inline void maybe_reallocate_page(struct typemanager *ntm,ufixnum count) { void **y,**n; @@ -248,7 +311,7 @@ int reserve_pages_for_signal_handler=30; reserve_pages_for_signal_handler pages on hand in the hole */ -inline void +void empty_relblock(void) { object o=sSAleaf_collection_thresholdA->s.s_dbind; @@ -262,7 +325,7 @@ empty_relblock(void) { } -inline void +static inline void resize_hole(ufixnum hp,enum type tp) { char *new_start=heap_end+hp*PAGESIZE; @@ -283,7 +346,7 @@ resize_hole(ufixnum hp,enum type tp) { } -inline void * +void * alloc_page(long n) { bool s=n<0; @@ -332,7 +395,7 @@ alloc_page(long n) { struct pageinfo *cell_list_head=NULL,*cell_list_tail=NULL;; -inline ufixnum +static inline ufixnum sum_maxpages(void) { ufixnum i,j; @@ -352,7 +415,7 @@ check_avail_pages(void) { } -inline fixnum +fixnum set_tm_maxpage(struct typemanager *tm,fixnum n) { fixnum r=tm->tm_type==t_relocatable,j=tm->tm_maxpage,z=(n-j)*(r ? 2 : 1); @@ -365,69 +428,6 @@ set_tm_maxpage(struct typemanager *tm,fixnum n) { return 1; } - -inline void -add_page_to_freelist(char *p, struct typemanager *tm) { - - short t,size; - long i=tm->tm_nppage,fw; - object x,f; - struct pageinfo *pp; - - t=tm->tm_type; - - size=tm->tm_size; - f=tm->tm_free; - pp=pageinfo(p); - bzero(pp,sizeof(*pp)); - pp->type=t; - pp->magic=PAGE_MAGIC; - - if (cell_list_head==NULL) - cell_list_tail=cell_list_head=pp; - else if (pp > cell_list_tail) { - cell_list_tail->next=pp; - cell_list_tail=pp; - } - - x= (object)pagetochar(page(p)); - /* set_type_of(x,t); */ - make_free(x); - -#ifdef SGC - - if (sgc_enabled && tm->tm_sgc) - pp->sgc_flags=SGC_PAGE_FLAG; - -#ifndef SGC_WHOLE_PAGE - if (TYPEWORD_TYPE_P(pp->type)) - x->d.s=(sgc_enabled && tm->tm_sgc) ? SGC_RECENT : SGC_NORMAL; -#endif - - /* array headers must be always writable, since a write to the - body does not touch the header. It may be desirable if there - are many arrays in a system to make the headers not writable, - but just SGC_TOUCH the header each time you write to it. this - is what is done with t_structure */ - if (t==(tm_of(t_array)->tm_type)) - pp->sgc_flags|=SGC_PERM_WRITABLE; - -#endif - - fw= *(fixnum *)x; - while (--i >= 0) { - *(fixnum *)x=fw; - SET_LINK(x,f); - f=x; - x= (object) ((char *)x + size); - } - - tm->tm_free=f; - tm->tm_nfree += tm->tm_nppage; - tm->tm_npage++; - -} - object type_name(int t) { return make_simple_string(tm_table[(int)t].tm_name+1); @@ -435,7 +435,7 @@ type_name(int t) { static void -call_after_gbc_hook(t) { +call_after_gbc_hook(int t) { if (sSAafter_gbc_hookA && sSAafter_gbc_hookA->s.s_dbind!= Cnil) { set_up_string_register(tm_table[(int)t].tm_name+1); ifuncall1(sSAafter_gbc_hookA->s.s_dbind,intern(string_register,system_package)); @@ -536,7 +536,7 @@ rebalance_maxpages(struct typemanager *my_tm,fixnum z) { } -inline long +long opt_maxpage(struct typemanager *my_tm) { double x=0.0,y=0.0,z,r; @@ -707,7 +707,7 @@ find_contblock(ufixnum n,void **p) { return find_cbpp(*p,n); } -inline void +void print_cb(int print) { struct contblock *cbp,***cbppp,**cbpp=&cb_pointer; @@ -729,7 +729,7 @@ print_cb(int print) { } -inline void +void insert_contblock(void *p,ufixnum s) { struct contblock *cbp=p,**cbpp,***cbppp; @@ -761,7 +761,7 @@ delete_contblock(void *p,struct contblock **cbpp) { } -inline void +void reset_contblock_freelist(void) { cb_pointer=NULL; @@ -769,7 +769,7 @@ reset_contblock_freelist(void) { } -inline void * +static inline void * alloc_from_freelist(struct typemanager *tm,fixnum n) { void *p; @@ -851,7 +851,7 @@ too_full_p(struct typemanager *tm) { } -inline void * +static inline void * alloc_after_gc(struct typemanager *tm,fixnum n) { if (tm->tm_npage+tpage(tm,n)>tm->tm_maxpage && GBC_enable) { @@ -883,7 +883,7 @@ alloc_after_gc(struct typemanager *tm,fixnum n) { } -inline void +void add_pages(struct typemanager *tm,fixnum m) { switch (tm->tm_type) { @@ -923,7 +923,7 @@ add_pages(struct typemanager *tm,fixnum m) { } -inline void * +static inline void * alloc_after_adding_pages(struct typemanager *tm,fixnum n) { fixnum m=tpage(tm,n); @@ -945,7 +945,7 @@ alloc_after_adding_pages(struct typemanager *tm,fixnum n) { } -inline void * +static inline void * alloc_after_reclaiming_pages(struct typemanager *tm,fixnum n) { fixnum m=tpage(tm,n),reloc_min; @@ -972,10 +972,10 @@ alloc_after_reclaiming_pages(struct typemanager *tm,fixnum n) { } -inline void *alloc_mem(struct typemanager *,fixnum); +static inline void *alloc_mem(struct typemanager *,fixnum); #ifdef SGC -inline void * +static inline void * alloc_after_turning_off_sgc(struct typemanager *tm,fixnum n) { if (!sgc_enabled) return NULL; @@ -985,7 +985,7 @@ alloc_after_turning_off_sgc(struct typemanager *tm,fixnum n) { } #endif -inline void * +static inline void * alloc_mem(struct typemanager *tm,fixnum n) { void *p; @@ -1007,7 +1007,7 @@ alloc_mem(struct typemanager *tm,fixnum n) { return exhausted_report(tm->tm_type,tm); } -inline object +object alloc_object(enum type t) { object obj; @@ -1022,12 +1022,12 @@ alloc_object(enum type t) { } -inline void * +void * alloc_contblock(size_t n) { return alloc_mem(tm_of(t_contiguous),CEI(n,CPTR_SIZE)); } -inline void * +void * alloc_contblock_no_gc(size_t n) { struct typemanager *tm=tm_of(t_contiguous); @@ -1073,7 +1073,7 @@ alloc_code_space(size_t sz) { } -inline void * +void * alloc_relblock(size_t n) { return alloc_mem(tm_of(t_relocatable),CEI(n,PTR_ALIGN)); @@ -1089,7 +1089,7 @@ load_cons(object p,object a,object d) { p->c.c_car=a; } -inline object +object make_cons(object a,object d) { static struct typemanager *tm=tm_table+t_cons;/*FIXME*/ @@ -1105,7 +1105,7 @@ make_cons(object a,object d) { -inline object on_stack_cons(object x, object y) { +object on_stack_cons(object x, object y) { object p = (object) alloca_val; load_cons(p,x,y); return p; diff --git a/o/gbc.c b/o/gbc.c index c3c3297..d19f151 100755 --- a/o/gbc.c +++ b/o/gbc.c @@ -158,7 +158,7 @@ in_contblock_stack_list(void *p,void ***ap) { return a && a[0]==p; } -inline char +static inline char get_bit(char *v,struct pageinfo *pi,void *x) { void *ve=CB_DATA_START(pi); fixnum off=(x-ve)>>LOG_BYTES_CONTBLOCK,i=off>>LOG_BITS_CHAR,s=off&~(~0UL<>s)&0x1; } -inline void +static inline void set_bit(char *v,struct pageinfo *pi,void *x) { void *ve=CB_DATA_START(pi); fixnum off=(x-ve)>>LOG_BYTES_CONTBLOCK,i=off>>LOG_BITS_CHAR,s=off&~(~0UL<>LOG_BYTES_CONTBLOCK;i=_o>>LOG_BITS_CHAR;s=_o&~(~0UL< void change_contexts(); @@ -47,6 +45,11 @@ int ovm_process_created; void initialize_process(); #endif + +#define EXTER +#define INLINE + + #include "include.h" #include #include "page.h" @@ -118,7 +121,7 @@ cstack_dir(fixnum j) { fixnum log_maxpage_bound=sizeof(fixnum)*8-1; -inline int +int mbrk(void *v) { ufixnum uv=(ufixnum)v,uc=(ufixnum)sbrk(0),ux,um; @@ -1120,10 +1123,6 @@ init_main(void) { } -#ifdef SGC -#include "writable.h" -#endif - #ifdef HAVE_PRINT_INSN_I386 #include "dis-asm.h" diff --git a/o/makefile b/o/makefile index 8e9f63d..d604d26 100644 --- a/o/makefile +++ b/o/makefile @@ -20,7 +20,7 @@ OBJS:=$(addsuffix .o,typespec main alloc gbc bitop eval macros lex bds frame pre num_pred num_comp num_arith num_sfun num_co num_log num_rand earith character sequence list hash\ array string regexpr structure toplevel file read backq print format pathname unixfsys unixfasl\ error unixtime unixsys unixsave funlink fat_string run_process nfunlink usig usig2 utils makefun\ - sockets gmp_wrappers clxsocket init_pari nsocket sfasl prelink) + sockets clxsocket init_pari nsocket sfasl prelink) OBJS:=$(OBJS) $(RL_OBJS) $(EXTRAS) INI_FILES=$(patsubst %.o,%.ini,${OBJS}) diff --git a/o/num_arith.c b/o/num_arith.c index 7eabfc3..b912b87 100755 --- a/o/num_arith.c +++ b/o/num_arith.c @@ -62,7 +62,7 @@ object fixnum_sub(fixnum i, fixnum j) } } -inline object +object fixnum_times(fixnum i, fixnum j) { #ifdef HAVE_CLZL diff --git a/o/num_co.c b/o/num_co.c index 8cdf6d8..73403a6 100755 --- a/o/num_co.c +++ b/o/num_co.c @@ -277,7 +277,7 @@ LFD(Ldenominator)(void) vs_base[0] = small_fixnum(1); } -inline void +void intdivrem(object x,object y,fixnum d,object *q,object *r) { enum type tx=type_of(x),ty=type_of(y); diff --git a/o/num_log.c b/o/num_log.c index 53e50b6..6bd067f 100755 --- a/o/num_log.c +++ b/o/num_log.c @@ -37,12 +37,12 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. -inline object +object fixnum_big_shift(fixnum x,fixnum w) { MPOP(return,shifti,SI_TO_MP(x,big_fixnum1),w); } -inline object +object integer_fix_shift(object x, fixnum w) { if (type_of(x)==t_fixnum) { fixnum fx=fix(x); @@ -51,7 +51,7 @@ integer_fix_shift(object x, fixnum w) { MPOP(return,shifti,MP(x),w); } -inline object +object integer_shift(object x,object y) { enum type tx=type_of(x),ty=type_of(y); if (ty==t_fixnum) @@ -66,12 +66,12 @@ integer_shift(object x,object y) { } } -inline object +object integer_length(object x) { return make_fixnum(type_of(x)==t_fixnum ? fixnum_length(fix(x)) : MP_SIZE_IN_BASE2(MP(x))); } -inline object +object integer_count(object x) { return make_fixnum(type_of(x)==t_fixnum ? fixnum_count(fix(x)) : MP_BITCOUNT(MP(x))); } @@ -120,7 +120,7 @@ LFD(Lboole)(void) } -inline bool +bool integer_bitp(object p,object x) { enum type tp=type_of(p),tx=type_of(x); diff --git a/o/num_sfun.c b/o/num_sfun.c index 602fd71..cfd8bce 100755 --- a/o/num_sfun.c +++ b/o/num_sfun.c @@ -94,7 +94,7 @@ number_exp(object x) } } -inline object +static inline object number_fix_iexpt(object x,fixnum y,fixnum ly,fixnum j) { object z; @@ -103,7 +103,7 @@ number_fix_iexpt(object x,fixnum y,fixnum ly,fixnum j) { return fixnum_bitp(j,y) ? number_times(x,z) : z; } -inline object +static inline object number_big_iexpt(object x,object y,fixnum ly,fixnum j) { object z; @@ -113,7 +113,7 @@ number_big_iexpt(object x,object y,fixnum ly,fixnum j) { } -inline object +static inline object number_zero_expt(object x,bool promote_short_p) { switch (type_of(x)) { @@ -135,7 +135,7 @@ number_zero_expt(object x,bool promote_short_p) { } -inline object +static inline object number_ui_expt(object x,fixnum fy) { switch (type_of(x)) { @@ -173,17 +173,17 @@ number_ui_expt(object x,fixnum fy) { } -inline object +static inline object number_ump_expt(object x,object y) { return number_big_iexpt(x,y,fix(integer_length(y)),0); } -inline object +static inline object number_log_expt(object x,object y) { return number_zerop(y) ? number_zero_expt(y,type_of(x)==t_longfloat) : number_exp(number_times(number_nlog(x),y)); } -inline object +static inline object number_invert(object x,object y,object z) { switch (type_of(z)) { @@ -198,7 +198,7 @@ number_invert(object x,object y,object z) { } -inline object +static inline object number_si_expt(object x,object y) { switch (type_of(y)) { case t_fixnum: diff --git a/o/package.d b/o/package.d index 80b502b..1b31972 100755 --- a/o/package.d +++ b/o/package.d @@ -114,7 +114,7 @@ static int package_sizes[]={ 32749, 65521, 131071, 262139, 524287, 1048573}; static int -suitable_package_size(n) +suitable_package_size(int n) {int *i=package_sizes; if (n>= 1000000) return 1048573; while(*i < n) { i++;}