Added TODO's for GC of strings, now that storage has changed

This commit is contained in:
Justin Ethier 2015-10-13 02:41:35 -04:00
parent ba167dfcd3
commit 85cff010b6

View file

@ -2050,6 +2050,9 @@ char *transport(x, gcgen) char *x; int gcgen;
case string_tag: case string_tag:
{register string_type *nx = (string_type *) allocp; {register string_type *nx = (string_type *) allocp;
type_of(nx) = string_tag; 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) { if (gcgen == 0) {
// Minor, data heap is not relocated // Minor, data heap is not relocated
nx->str = ((string_type *)x)->str; 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"); printf("DEBUG transport string \n");
#endif #endif
scanp += sizeof(string_type); break; 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: case integer_tag:
#if DEBUG_GC #if DEBUG_GC
printf("DEBUG transport integer \n"); printf("DEBUG transport integer \n");