From 491081eefd85d6cab145242e812582d0459195b5 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Mon, 22 Jul 2019 07:53:59 -0600 Subject: [PATCH] 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. --- racket/src/racket/src/thread.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/racket/src/racket/src/thread.c b/racket/src/racket/src/thread.c index efc45fd8a7..068ae787c8 100644 --- a/racket/src/racket/src/thread.c +++ b/racket/src/racket/src/thread.c @@ -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; } }