mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-11 14:57:36 +02:00
Removed debug output
This commit is contained in:
parent
0d9e4c3234
commit
849b28b54c
3 changed files with 12 additions and 12 deletions
18
gc.c
18
gc.c
|
@ -22,9 +22,9 @@ gc_heap *gc_heap_create(size_t size, size_t max_size, size_t chunk_size)
|
|||
h->size = size;
|
||||
h->chunk_size = chunk_size;
|
||||
h->max_size = max_size;
|
||||
printf("DEBUG h->data addr: %p\n", &(h->data));
|
||||
//printf("DEBUG h->data addr: %p\n", &(h->data));
|
||||
h->data = (char *) gc_heap_align(sizeof(h->data) + (uint)&(h->data));
|
||||
printf("DEBUG h->data addr: %p\n", h->data);
|
||||
//printf("DEBUG h->data addr: %p\n", h->data);
|
||||
h->next = NULL;
|
||||
free = h->free_list = (gc_free_list *)h->data;
|
||||
next = (gc_free_list *)(((char *) free) + gc_heap_align(gc_free_chunk_size));
|
||||
|
@ -32,14 +32,14 @@ printf("DEBUG h->data addr: %p\n", h->data);
|
|||
free->next = next;
|
||||
next->size = size - gc_heap_align(gc_free_chunk_size);
|
||||
next->next = NULL;
|
||||
//#if GC_DEBUG_PRINTFS
|
||||
fprintf(stderr, ("heap: %p-%p data: %p-%p"),
|
||||
#if GC_DEBUG_PRINTFS
|
||||
fprintf(stderr, ("heap: %p-%p data: %p-%p\n"),
|
||||
h, ((char*)h)+gc_heap_pad_size(size), h->data, h->data + size);
|
||||
fprintf(stderr, ("first: %p end: %p"),
|
||||
fprintf(stderr, ("first: %p end: %p\n"),
|
||||
(object)gc_heap_first_block(h), (object)gc_heap_end(h));
|
||||
fprintf(stderr, ("free1: %p-%p free2: %p-%p"),
|
||||
fprintf(stderr, ("free1: %p-%p free2: %p-%p\n"),
|
||||
free, ((char*)free)+free->size, next, ((char*)next)+next->size);
|
||||
//#endif
|
||||
#endif
|
||||
return h;
|
||||
}
|
||||
|
||||
|
@ -109,9 +109,9 @@ void *gc_alloc(gc_heap *h, size_t size, int *heap_grown)
|
|||
exit(1); // TODO: throw error???
|
||||
}
|
||||
}
|
||||
//#if GC_DEBUG_PRINTFS
|
||||
#if GC_DEBUG_PRINTFS
|
||||
fprintf(stdout, "alloc %p size = %d\n", result, size);
|
||||
//#endif
|
||||
#endif
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
@ -82,7 +82,7 @@ void gc_thr_add_to_move_buffer(gc_thread_data *d, int *alloci, object obj);
|
|||
|
||||
/* GC debugging flags */
|
||||
//#define DEBUG_GC 0
|
||||
#define GC_DEBUG_PRINTFS 1
|
||||
#define GC_DEBUG_PRINTFS 0
|
||||
|
||||
/* Show diagnostic information for the GC when program terminates */
|
||||
#define DEBUG_SHOW_DIAG 0
|
||||
|
|
|
@ -2380,7 +2380,7 @@ size_t gc_collect(gc_heap *h, size_t *sum_freed)
|
|||
char *gc_move(char *obj, gc_thread_data *thd, int *alloci, int *heap_grown) {
|
||||
if (!is_object_type(obj)) return obj;
|
||||
|
||||
printf("DEBUG gc_move type = %ld\n", type_of(obj)); // JAE DEBUG
|
||||
//printf("DEBUG gc_move type = %ld\n", type_of(obj)); // JAE DEBUG
|
||||
switch(type_of(obj)){
|
||||
case cons_tag: {
|
||||
list hp = gc_alloc(Cyc_heap, sizeof(cons_type), heap_grown); // hp ==> new heap object
|
||||
|
@ -2716,7 +2716,7 @@ fprintf(stdout, "DEBUG, starting major mark/sweep GC\n"); // JAE DEBUG
|
|||
}
|
||||
max_freed = gc_collect(Cyc_heap, &freed);
|
||||
printf("done, freed = %d, max_freed = %d\n", freed, max_freed);
|
||||
exit(1); // JAE DEBUG
|
||||
//exit(1); // JAE DEBUG
|
||||
}
|
||||
|
||||
//fprintf(stdout, "DEBUG, finished minor GC\n"); // JAE DEBUG
|
||||
|
|
Loading…
Add table
Reference in a new issue