Noted TODO

This commit is contained in:
Justin Ethier 2015-10-20 00:33:42 -04:00
parent 1505274640
commit 87def0fc67

View file

@ -2593,6 +2593,7 @@ void GC(cont, args, num_args) closure cont; object *args; int num_args;
int scani = 0, alloci = 0; // TODO: not quite sure how to do this yet, want to user pointers but realloc can move them... need to think about how this will work
int heap_grown = 0;
fprintf("DEBUG, started minor GC\n"); // JAE DEBUG
// Prevent overrunning buffer
if (num_args > NUM_GC_ANS) {
printf("Fatal error - too many arguments (%d) to GC\n", num_args);
@ -2706,11 +2707,14 @@ void GC(cont, args, num_args) closure cont; object *args; int num_args;
// Check if we need to do a major GC
if (heap_grown) {
size_t freed = 0;
// TODO: not good enough, need to pass current cont/args
// what about mutation barrier, do we care at this point???
fprintf("DEBUG, starting major mark/sweep GC\n"); // JAE DEBUG
TODO: not good enough, need to pass current cont/args
what about mutation barrier, do we care at this point???
I don't think so because those are just updates to globals
gc_collect(Cyc_heap, &freed);
}
fprintf("DEBUG, finished minor GC\n"); // JAE DEBUG
longjmp(jmp_main,1); // Return globals gc_cont, gc_ans
}