mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-05 12:16:35 +02:00
Tweak GC debugging
This commit is contained in:
parent
7c49e59ad6
commit
dc19539bff
2 changed files with 8 additions and 4 deletions
2
gc.c
2
gc.c
|
@ -446,7 +446,7 @@ void *gc_alloc(gc_heap *h, size_t size, char *obj, gc_thread_data *thd, int *hea
|
||||||
exit(1); // could throw error, but OOM is a major issue, so...
|
exit(1); // could throw error, but OOM is a major issue, so...
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#if GC_DEBUG_TRACE
|
#if GC_DEBUG_VERBOSE
|
||||||
fprintf(stderr, "alloc %p size = %zu, obj=%p, tag=%ld, mark=%d\n", result, size, obj, type_of(obj), mark(((object)result)));
|
fprintf(stderr, "alloc %p size = %zu, obj=%p, tag=%ld, mark=%d\n", result, size, obj, type_of(obj), mark(((object)result)));
|
||||||
// Debug check, should no longer be necessary
|
// Debug check, should no longer be necessary
|
||||||
//if (is_value_type(result)) {
|
//if (is_value_type(result)) {
|
||||||
|
|
10
runtime.c
10
runtime.c
|
@ -2361,6 +2361,10 @@ int gc_minor(void *data, object low_limit, object high_limit, closure cont, obje
|
||||||
int scani = 0, alloci = 0;
|
int scani = 0, alloci = 0;
|
||||||
int heap_grown = 0;
|
int heap_grown = 0;
|
||||||
|
|
||||||
|
#if GC_DEBUG_TRACE
|
||||||
|
fprintf(stderr, "started minor GC\n");
|
||||||
|
#endif
|
||||||
|
|
||||||
//fprintf(stdout, "DEBUG, started minor GC\n"); // JAE DEBUG
|
//fprintf(stdout, "DEBUG, started minor GC\n"); // JAE DEBUG
|
||||||
// Prevent overrunning buffer
|
// Prevent overrunning buffer
|
||||||
if (num_args > NUM_GC_ANS) {
|
if (num_args > NUM_GC_ANS) {
|
||||||
|
@ -2474,6 +2478,9 @@ int gc_minor(void *data, object low_limit, object high_limit, closure cont, obje
|
||||||
}
|
}
|
||||||
scani++;
|
scani++;
|
||||||
}
|
}
|
||||||
|
#if GC_DEBUG_TRACE
|
||||||
|
fprintf(stderr, "done with minor GC\n");
|
||||||
|
#endif
|
||||||
return alloci;
|
return alloci;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2490,9 +2497,6 @@ void GC(void *data, closure cont, object *args, int num_args)
|
||||||
int alloci = gc_minor(data, low_limit, high_limit, cont, args, num_args);
|
int alloci = gc_minor(data, low_limit, high_limit, cont, args, num_args);
|
||||||
// Cooperate with the collector thread
|
// Cooperate with the collector thread
|
||||||
gc_mut_cooperate((gc_thread_data *)data, alloci);
|
gc_mut_cooperate((gc_thread_data *)data, alloci);
|
||||||
#if GC_DEBUG_TRACE
|
|
||||||
fprintf(stderr, "done with minor GC\n");
|
|
||||||
#endif
|
|
||||||
// Let it all go, Neo...
|
// Let it all go, Neo...
|
||||||
longjmp(*(((gc_thread_data *)data)->jmp_start), 1);
|
longjmp(*(((gc_thread_data *)data)->jmp_start), 1);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue