106 |
{ |
{ |
107 |
holepage = new_holepage + n; |
holepage = new_holepage + n; |
108 |
|
|
109 |
{int in_sgc=sgc_enabled; |
{ |
110 |
|
#ifdef SGC |
111 |
|
int in_sgc=sgc_enabled; |
112 |
if (in_sgc) sgc_quit(); |
if (in_sgc) sgc_quit(); |
113 |
|
#endif |
114 |
if(in_signal_handler) |
if(in_signal_handler) |
115 |
{fprintf(stderr, |
{fprintf(stderr, |
116 |
"Cant do relocatable gc in signal handler. \ |
"Cant do relocatable gc in signal handler. \ |
118 |
eg to add 20 more do (si::set-hole-size %ld %d)\n...start over ", new_holepage, 20+ reserve_pages_for_signal_handler); fflush(stderr); exit(1);} |
eg to add 20 more do (si::set-hole-size %ld %d)\n...start over ", new_holepage, 20+ reserve_pages_for_signal_handler); fflush(stderr); exit(1);} |
119 |
|
|
120 |
GBC(t_relocatable); |
GBC(t_relocatable); |
121 |
|
#ifdef SGC |
122 |
if (in_sgc) |
if (in_sgc) |
123 |
{sgc_start(); |
{sgc_start(); |
124 |
/* starting sgc can use up some pages |
/* starting sgc can use up some pages |
125 |
and may move heap end, so start over |
and may move heap end, so start over |
126 |
*/ |
*/ |
127 |
return alloc_page(n);} |
return alloc_page(n);} |
128 |
|
#endif |
129 |
} |
} |
130 |
} |
} |
131 |
holepage -= n; |
holepage -= n; |
150 |
#ifdef SGC |
#ifdef SGC |
151 |
if (sgc_enabled) |
if (sgc_enabled) |
152 |
make_writable(page(core_end),page(core_end)+n-m); |
make_writable(page(core_end),page(core_end)+n-m); |
|
|
|
153 |
#endif |
#endif |
154 |
core_end += PAGESIZE*(n - m); |
core_end += PAGESIZE*(n - m); |
155 |
return(e);} |
return(e);} |
253 |
obj->d.t = (short)t; |
obj->d.t = (short)t; |
254 |
obj->d.m = FALSE; |
obj->d.m = FALSE; |
255 |
return(obj); |
return(obj); |
256 |
|
#ifdef SGC |
257 |
#define TOTAL_THIS_TYPE(tm) \ |
#define TOTAL_THIS_TYPE(tm) \ |
258 |
(tm->tm_nppage * (sgc_enabled ? sgc_count_type(tm->tm_type) : tm->tm_npage)) |
(tm->tm_nppage * (sgc_enabled ? sgc_count_type(tm->tm_type) : tm->tm_npage)) |
259 |
|
#else |
260 |
|
#define TOTAL_THIS_TYPE(tm) \ |
261 |
|
(tm->tm_nppage * tm->tm_npage) |
262 |
|
#endif |
263 |
CALL_GBC: |
CALL_GBC: |
264 |
GBC(tm->tm_type); |
GBC(tm->tm_type); |
265 |
if (tm->tm_nfree == 0 || |
if (tm->tm_nfree == 0 || |
498 |
pages for SGC, causing no contiguous pages to be |
pages for SGC, causing no contiguous pages to be |
499 |
swept when SGC was on. Here we follow the behavior |
swept when SGC was on. Here we follow the behavior |
500 |
for other pages in add_to_freelist. CM 20030827 */ |
for other pages in add_to_freelist. CM 20030827 */ |
501 |
|
#ifdef SGC |
502 |
if (SGC_CONT_ENABLED) |
if (SGC_CONT_ENABLED) |
503 |
sgc_type_map[page(p)+i]|= SGC_PAGE_FLAG; |
sgc_type_map[page(p)+i]|= SGC_PAGE_FLAG; |
504 |
|
#endif |
505 |
} |
} |
506 |
ncbpage += m; |
ncbpage += m; |
507 |
insert_contblock(p+n, PAGESIZE*m - n); |
insert_contblock(p+n, PAGESIZE*m - n); |
511 |
/* SGC cont pages: explicit free calls can come at any time, and we |
/* SGC cont pages: explicit free calls can come at any time, and we |
512 |
must make sure to add the newly deallocated block to the right |
must make sure to add the newly deallocated block to the right |
513 |
list. CM 20030827*/ |
list. CM 20030827*/ |
514 |
|
#ifdef SGC |
515 |
void |
void |
516 |
insert_maybe_sgc_contblock(char *p,int s) { |
insert_maybe_sgc_contblock(char *p,int s) { |
517 |
|
|
529 |
insert_contblock(p,s); |
insert_contblock(p,s); |
530 |
|
|
531 |
} |
} |
532 |
|
#endif |
533 |
|
|
534 |
#ifdef SGC_CONT_DEBUG |
#ifdef SGC_CONT_DEBUG |
535 |
extern void overlap_check(struct contblock *,struct contblock *); |
extern void overlap_check(struct contblock *,struct contblock *); |
560 |
} |
} |
561 |
if (sgc_enabled) |
if (sgc_enabled) |
562 |
overlap_check(old_cb_pointer,cb_pointer); |
overlap_check(old_cb_pointer,cb_pointer); |
|
|
|
563 |
#endif |
#endif |
564 |
cbp->cb_link = *cbpp; |
cbp->cb_link = *cbpp; |
565 |
*cbpp = cbp; |
*cbpp = cbp; |
997 |
pages for SGC, causing no contiguous pages to be |
pages for SGC, causing no contiguous pages to be |
998 |
swept when SGC was on. Here we follow the behavior |
swept when SGC was on. Here we follow the behavior |
999 |
for other pages in add_to_freelist. CM 20030827 */ |
for other pages in add_to_freelist. CM 20030827 */ |
1000 |
|
#ifdef SGC |
1001 |
if (SGC_CONT_ENABLED) |
if (SGC_CONT_ENABLED) |
1002 |
sgc_type_map[page(p)+i]|= SGC_PAGE_FLAG; |
sgc_type_map[page(p)+i]|= SGC_PAGE_FLAG; |
1003 |
|
#endif |
1004 |
} |
} |
1005 |
|
|
1006 |
ncbpage += m; |
ncbpage += m; |
1246 |
for (p = &malloc_list; *p && !endp(*p); p = &((*p)->c.c_cdr)) |
for (p = &malloc_list; *p && !endp(*p); p = &((*p)->c.c_cdr)) |
1247 |
if ((*p)->c.c_car->st.st_self == ptr) { |
if ((*p)->c.c_car->st.st_self == ptr) { |
1248 |
/* SGC contblock pages: Its possible this is on an old page CM 20030827 */ |
/* SGC contblock pages: Its possible this is on an old page CM 20030827 */ |
1249 |
|
#ifdef SGC |
1250 |
insert_maybe_sgc_contblock((*p)->c.c_car->st.st_self, |
insert_maybe_sgc_contblock((*p)->c.c_car->st.st_self, |
1251 |
(*p)->c.c_car->st.st_dim); |
(*p)->c.c_car->st.st_dim); |
1252 |
|
#else |
1253 |
|
insert_contblock((*p)->c.c_car->st.st_self, |
1254 |
|
(*p)->c.c_car->st.st_dim); |
1255 |
|
#endif |
1256 |
(*p)->c.c_car->st.st_self = NULL; |
(*p)->c.c_car->st.st_self = NULL; |
1257 |
*p = (*p)->c.c_cdr; |
*p = (*p)->c.c_cdr; |
1258 |
return ; |
return ; |
1301 |
for (i = 0; i < size; i++) |
for (i = 0; i < size; i++) |
1302 |
x->st.st_self[i] = ((char *)ptr)[i]; |
x->st.st_self[i] = ((char *)ptr)[i]; |
1303 |
/* SGC contblock pages: Its possible this is on an old page CM 20030827 */ |
/* SGC contblock pages: Its possible this is on an old page CM 20030827 */ |
1304 |
|
#ifdef SGC |
1305 |
insert_maybe_sgc_contblock(ptr, j); |
insert_maybe_sgc_contblock(ptr, j); |
1306 |
|
#else |
1307 |
|
insert_contblock(ptr, j); |
1308 |
|
#endif |
1309 |
return(x->st.st_self); |
return(x->st.st_self); |
1310 |
} |
} |
1311 |
} |
} |