105 |
static int gc_time = -1; |
static int gc_time = -1; |
106 |
static int gc_start = 0; |
static int gc_start = 0; |
107 |
static int gc_recursive = 0; |
static int gc_recursive = 0; |
108 |
int sgc_enabled = 0; |
#ifdef SGC |
109 |
|
int sgc_enabled=0; |
110 |
|
#endif |
111 |
int first_protectable_page = 0; |
int first_protectable_page = 0; |
112 |
|
|
113 |
int runtime(void); |
int runtime(void); |
114 |
|
|
|
|
|
115 |
static char *copy_relblock(char *p, int s); |
static char *copy_relblock(char *p, int s); |
116 |
|
|
|
|
|
117 |
extern bool saving_system; |
extern bool saving_system; |
118 |
extern long real_maxpage; |
extern long real_maxpage; |
119 |
extern long new_holepage; |
extern long new_holepage; |
1054 |
|
|
1055 |
int i, j; |
int i, j; |
1056 |
struct apage *pp, *qq; |
struct apage *pp, *qq; |
1057 |
|
#ifdef SGC |
1058 |
int in_sgc = sgc_enabled; |
int in_sgc = sgc_enabled; |
1059 |
|
#endif |
1060 |
#ifdef DEBUG |
#ifdef DEBUG |
1061 |
int tm=0; |
int tm=0; |
1062 |
#endif |
#endif |
1073 |
|
|
1074 |
if (saving_system) |
if (saving_system) |
1075 |
{t = t_contiguous; gc_time = -1; |
{t = t_contiguous; gc_time = -1; |
1076 |
|
#ifdef SGC |
1077 |
if(sgc_enabled) sgc_quit(); |
if(sgc_enabled) sgc_quit(); |
1078 |
|
#endif |
1079 |
} |
} |
1080 |
|
|
1081 |
|
|
1091 |
if (debug || (sSAnotify_gbcA->s.s_dbind != Cnil)) { |
if (debug || (sSAnotify_gbcA->s.s_dbind != Cnil)) { |
1092 |
|
|
1093 |
if (gc_time < 0) gc_time=0; |
if (gc_time < 0) gc_time=0; |
1094 |
|
#ifdef SGC |
1095 |
printf("[%s for %d %s pages..", |
printf("[%s for %d %s pages..", |
1096 |
(sgc_enabled ? "SGC" : "GC"), |
(sgc_enabled ? "SGC" : "GC"), |
1097 |
(sgc_enabled ? sgc_count_type(t) : tm_of(t)->tm_npage), |
(sgc_enabled ? sgc_count_type(t) : tm_of(t)->tm_npage), |
1098 |
(tm_table[(int)t].tm_name)+1); |
(tm_table[(int)t].tm_name)+1); |
1099 |
|
#else |
1100 |
|
printf("[%s for %d %s pages..", |
1101 |
|
("GC"), |
1102 |
|
(tm_of(t)->tm_npage), |
1103 |
|
(tm_table[(int)t].tm_name)+1); |
1104 |
|
#endif |
1105 |
#ifdef SGC |
#ifdef SGC |
1106 |
if(sgc_enabled) |
if(sgc_enabled) |
1107 |
printf("(%d writable)..",sgc_count_writable(page(core_end))); |
printf("(%d writable)..",sgc_count_writable(page(core_end))); |
1126 |
j = 0; |
j = 0; |
1127 |
/* if in sgc we don't need more pages below hole |
/* if in sgc we don't need more pages below hole |
1128 |
just more relocatable or cleaning it */ |
just more relocatable or cleaning it */ |
1129 |
if (sgc_enabled ==0 && holepage < new_holepage) |
#ifdef SGC |
1130 |
holepage = new_holepage; |
if (sgc_enabled==0) |
1131 |
|
#endif |
1132 |
|
if (holepage < new_holepage) |
1133 |
|
holepage = new_holepage; |
1134 |
|
|
1135 |
|
#ifdef SGC |
1136 |
i = rb_pointer - (sgc_enabled ? old_rb_start : rb_start); |
i = rb_pointer - (sgc_enabled ? old_rb_start : rb_start); |
1137 |
|
#else |
1138 |
|
i = rb_pointer - rb_start; |
1139 |
|
#endif |
1140 |
|
|
1141 |
if (nrbpage > (real_maxpage-page(heap_end) |
if (nrbpage > (real_maxpage-page(heap_end) |
1142 |
-holepage-real_maxpage/32)/2) { |
-holepage-real_maxpage/32)/2) { |
1143 |
if (i > nrbpage*PAGESIZE) |
if (i > nrbpage*PAGESIZE) |
1151 |
if (saving_system) |
if (saving_system) |
1152 |
rb_start = heap_end; |
rb_start = heap_end; |
1153 |
else |
else |
1154 |
|
#ifdef SGC |
1155 |
if (sgc_enabled==0) |
if (sgc_enabled==0) |
1156 |
|
#endif |
1157 |
{rb_start = heap_end + PAGESIZE*holepage;} |
{rb_start = heap_end + PAGESIZE*holepage;} |
1158 |
|
|
1159 |
rb_end = heap_end + (holepage + nrbpage) *PAGESIZE; |
rb_end = heap_end + (holepage + nrbpage) *PAGESIZE; |
1304 |
|
|
1305 |
interrupt_enable = TRUE; |
interrupt_enable = TRUE; |
1306 |
|
|
1307 |
|
#ifdef SGC |
1308 |
if (in_sgc && sgc_enabled==0) |
if (in_sgc && sgc_enabled==0) |
1309 |
sgc_start(); |
sgc_start(); |
1310 |
|
#endif |
1311 |
|
|
1312 |
if (saving_system) { |
if (saving_system) { |
1313 |
j = (rb_pointer-rb_start+PAGESIZE-1) / PAGESIZE; |
j = (rb_pointer-rb_start+PAGESIZE-1) / PAGESIZE; |
1339 |
ncb = 0; |
ncb = 0; |
1340 |
|
|
1341 |
/* hmm.... why is this test necessary.*/ |
/* hmm.... why is this test necessary.*/ |
1342 |
if (sgc_enabled==0) {holepage = new_holepage; |
#ifdef SGC |
1343 |
nrbpage = INIT_NRBPAGE;} |
if (sgc_enabled==0) |
1344 |
|
#endif |
1345 |
|
{holepage = new_holepage; |
1346 |
|
nrbpage = INIT_NRBPAGE;} |
1347 |
|
|
1348 |
if (nrbpage < 0) |
if (nrbpage < 0) |
1349 |
error("no relocatable pages left"); |
error("no relocatable pages left"); |