allocate_code_block_reserve(void);
void *
-alloc_contblock_no_gc(size_t);
+alloc_contblock_no_gc(size_t,char *);
void
reset_contblock_freelist(void);
}
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;
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;
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;
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) {