Skip to content

Commit 147af90

Browse files
committed
Un-break GCPROTECT with per-Input pspaces.
The interaction between pspaces and GCPROTECT is still weak after this commit, which may be a to-do to fix, but it isn't actively broken anymore.
1 parent f8a735f commit 147af90

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

gc.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ Tag StringTag;
4242
static Space *new, *old, *pspace;
4343
#if GCPROTECT
4444
static Space *spaces;
45-
/* FIXME: static Space *pspaces; */
4645
#endif
4746
static Root *globalrootlist, *exceptionrootlist;
4847
static size_t minspace = MIN_minspace; /* minimum number of bytes in a new space */
@@ -207,7 +206,7 @@ static void deprecate(Space *space) {
207206
assert(space != NULL);
208207
for (base = space; base->next != NULL; base = base->next)
209208
;
210-
assert(&spaces[0] <= base && base < &spaces[NSPACES]);
209+
assert(space == pspace || (&spaces[0] <= base && base < &spaces[NSPACES]));
211210
for (;;) {
212211
invalidate(space->bot, SPACESIZE(space));
213212
if (space == base)
@@ -527,7 +526,9 @@ extern void *pseal(void *p) {
527526
#endif
528527
deprecate(pspace);
529528
#if GCPROTECT
530-
pspace = mkspace(base, NULL, minpspace);
529+
/* TODO: integrate pspace with GCPROTECT better? */
530+
/* pspace = mkspace(base, NULL, minpspace); */
531+
pspace = newpspace(NULL);
531532
#else
532533
pspace = newpspace(NULL);
533534
#endif

0 commit comments

Comments
 (0)