Skip to content

Commit ec430cb

Browse files
committed
Make pseal(NULL) work okay
1 parent 2c05f72 commit ec430cb

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

gc.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ extern void *pseal(void *p) {
471471
if (psize == 0)
472472
return p;
473473

474-
/* TODO: this is an overestimate since it contains garbage */
474+
/* TODO: this is an overestimate since it includes garbage */
475475
gcreserve(psize);
476476
pmode = TRUE;
477477
VERBOSE(("Reserved %d for pspace copy\n", psize));
@@ -483,10 +483,12 @@ extern void *pseal(void *p) {
483483
for (sp = pspace; sp != NULL; sp = sp->next)
484484
VERBOSE(("GC pspace = %ux ... %ux\n", sp->bot, sp->current));
485485
#endif
486-
VERBOSE(("GC new space = %ux ... %ux\n", new->bot, new->top));
486+
if (p != NULL) {
487+
VERBOSE(("GC new space = %ux ... %ux\n", new->bot, new->top));
487488

488-
p = forward(p);
489-
(*(TAG(p))->scan)(p);
489+
p = forward(p);
490+
(*(TAG(p))->scan)(p);
491+
}
490492

491493
/* TODO: possible performance win: save+reuse the first pspace */
492494
for (sp = pspace; sp != NULL;) {

input.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ extern Tree *parse(List *fc) {
237237

238238
parsing = FALSE;
239239
fillcmd = NULL;
240+
pseal(NULL);
240241
throw(e);
241242

242243
EndExceptionHandler

0 commit comments

Comments
 (0)