mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-23 20:15:05 +02:00
Added debug statements
This commit is contained in:
parent
a9c0411a16
commit
7a45137ca2
2 changed files with 8 additions and 2 deletions
5
gc.c
5
gc.c
|
@ -225,7 +225,9 @@ fprintf(stdout, "sweep heap %p, size = %d\n", h, h->size);
|
|||
|
||||
if ((char *)r == (char *)p) { // this is a free block, skip it
|
||||
p = (object) (((char *)p) + r->size);
|
||||
fprintf(stdout, "skip free block %p size = %d\n", p, r->size);
|
||||
#if GC_DEBUG_PRINTFS
|
||||
fprintf(stdout, "skip free block %p size = %d\n", p, r->size);
|
||||
#endif
|
||||
continue;
|
||||
}
|
||||
size = gc_heap_align(gc_allocated_bytes(p));
|
||||
|
@ -308,6 +310,7 @@ void gc_thr_grow_move_buffer(gc_thread_data *d)
|
|||
}
|
||||
|
||||
d->moveBuf = realloc(d->moveBuf, d->moveBufLen * sizeof(void *));
|
||||
printf("grew moveBuffer, len = %d\n", d->moveBufLen);
|
||||
}
|
||||
|
||||
void gc_thr_add_to_move_buffer(gc_thread_data *d, int *alloci, object obj)
|
||||
|
|
|
@ -2708,8 +2708,11 @@ void GC(cont, args, num_args) closure cont; object *args; int num_args;
|
|||
scani++;
|
||||
}
|
||||
|
||||
//fprintf(stdout, "DEBUG done minor GC, alloci = %d\n", alloci);
|
||||
|
||||
// Check if we need to do a major GC
|
||||
if (heap_grown) {
|
||||
time_t majorStart = time(NULL);
|
||||
size_t freed = 0, max_freed = 0;
|
||||
fprintf(stdout, "DEBUG, starting major mark/sweep GC\n"); // JAE DEBUG
|
||||
gc_mark(Cyc_heap, cont);
|
||||
|
@ -2717,7 +2720,7 @@ fprintf(stdout, "DEBUG, starting major mark/sweep GC\n"); // JAE DEBUG
|
|||
gc_mark(Cyc_heap, args[i]);
|
||||
}
|
||||
max_freed = gc_collect(Cyc_heap, &freed);
|
||||
printf("done, freed = %d, max_freed = %d\n", freed, max_freed);
|
||||
printf("done, freed = %d, max_freed = %d, elapsed = %ld\n", freed, max_freed, time(NULL) - majorStart);
|
||||
//JAE_DEBUG++;
|
||||
//if (JAE_DEBUG == 2) exit(1); // JAE DEBUG
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue