From 849b28b54c5f7737a743b4220ce037059fe8f8a4 Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Fri, 23 Oct 2015 02:32:15 -0400 Subject: [PATCH] Removed debug output --- gc.c | 18 +++++++++--------- include/cyclone/types.h | 2 +- runtime.c | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/gc.c b/gc.c index f0776323..bbe82c85 100644 --- a/gc.c +++ b/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; } diff --git a/include/cyclone/types.h b/include/cyclone/types.h index d8fc47d1..90f8bf41 100644 --- a/include/cyclone/types.h +++ b/include/cyclone/types.h @@ -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 diff --git a/runtime.c b/runtime.c index 34429855..f13ad143 100644 --- a/runtime.c +++ b/runtime.c @@ -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