From 85cff010b618479d59710da13c1bfda4a8be3d92 Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Tue, 13 Oct 2015 02:41:35 -0400 Subject: [PATCH] Added TODO's for GC of strings, now that storage has changed --- runtime.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/runtime.c b/runtime.c index 1c7a81f8..8eaf2e2b 100644 --- a/runtime.c +++ b/runtime.c @@ -2050,6 +2050,9 @@ char *transport(x, gcgen) char *x; int gcgen; case string_tag: {register string_type *nx = (string_type *) allocp; type_of(nx) = string_tag; +TODO: below is changing, now we will need to always copy the cstring +along with the string_type. need to be careful of any off-by-one errors +here... if (gcgen == 0) { // Minor, data heap is not relocated nx->str = ((string_type *)x)->str; @@ -2278,6 +2281,10 @@ void GC_loop(int major, closure cont, object *ans, int num_ans) printf("DEBUG transport string \n"); #endif scanp += sizeof(string_type); break; +TODO: cstring is now after string_type, so need to skip that, too. +stack allocations should be OK since we are only scanning the newspace here, +but should double-check that... (though we are not able to even scan the +stack so should be fine) case integer_tag: #if DEBUG_GC printf("DEBUG transport integer \n");