cgc: don't use GC_free on runstacks

Using GC_free() on runstacks was a way of reducing leaks with
conservative GC, but the implementation of prompts for delimited
continuations evolved in a way that is incompatible with using
GC_free(). The recent change to make certain runstack links weak
particularly exposed the mismatch.
This commit is contained in:
Matthew Flatt 2019-07-22 07:53:59 -06:00
parent 710dc3b67a
commit 491081eefd

View File

@ -3216,18 +3216,10 @@ static void remove_thread(Scheme_Thread *r)
} else {
/* Only this thread used the runstack, so clear/free it
as aggressively as possible */
#if defined(SENORA_GC_NO_FREE) || defined(MZ_PRECISE_GC)
memset(r->runstack_start, 0, r->runstack_size * sizeof(Scheme_Object*));
#else
GC_free(r->runstack_start);
#endif
r->runstack_start = NULL;
for (saved = r->runstack_saved; saved; saved = saved->prev) {
#if defined(SENORA_GC_NO_FREE) || defined(MZ_PRECISE_GC)
memset(saved->runstack_start, 0, saved->runstack_size * sizeof(Scheme_Object*));
#else
GC_free(saved->runstack_start);
#endif
saved->runstack_start = NULL;
}
}