From 23453d264b3f99058a1966ef1a6d9574e589b5b6 Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Thu, 5 Nov 2015 22:17:26 -0500 Subject: [PATCH] Removed unused globals --- include/cyclone/runtime-main.h | 16 ---------------- include/cyclone/runtime.h | 11 ----------- runtime.c | 19 ------------------- 3 files changed, 46 deletions(-) diff --git a/include/cyclone/runtime-main.h b/include/cyclone/runtime-main.h index 9b2499b4..2b5acc34 100644 --- a/include/cyclone/runtime-main.h +++ b/include/cyclone/runtime-main.h @@ -43,22 +43,6 @@ static void Cyc_main (stack_size,heap_size,stack_base) Cyc_thread->gc_ans[0] = &clos_halt; Cyc_thread->gc_num_ans = 1; - // JAE TODO: clean up below (and all of this old code, really) - bottom = calloc(1,heap_size); - allocp = (char *) ((((long) bottom)+7) & -8); - alloc_end = allocp + heap_size - 8; - - dhallocp = dhbottom = calloc(1, heap_size); - dhalloc_limit = dhallocp + (long)((heap_size - 8) * 0.90); - dhalloc_end = dhallocp + heap_size - 8; -#if DEBUG_SHOW_DIAG - printf("main: heap_size=%ld allocp=%p alloc_end=%p\n", - (long) heap_size,(void *)allocp,(void *)alloc_end); - printf("main: Try a larger heap_size if program bombs.\n"); - printf("Starting...\n"); -#endif - start = clock(); /* Start the timing clock. */ - /* Tank, load the jump program... */ setjmp(*(Cyc_thread->jmp_start)); #if DEBUG_GC diff --git a/include/cyclone/runtime.h b/include/cyclone/runtime.h index 78a2a55f..9af39714 100644 --- a/include/cyclone/runtime.h +++ b/include/cyclone/runtime.h @@ -209,17 +209,6 @@ void do_dispatch(void *data, int argc, function_type func, object clo, object *b /* Global variables. */ extern gc_heap *Cyc_heap; extern gc_thread_data *Cyc_thread; -extern clock_t start; /* Starting time. */ -extern char *bottom; /* Bottom of tospace. */ -extern char *allocp; /* Cheney allocate pointer. */ -extern char *alloc_end; -/* TODO: not sure this is the best strategy for strings, especially if there - are a lot of long, later gen strings because that will cause a lot of - copying to occur during GC */ -extern char *dhbottom; /* Bottom of data heap */ -extern char *dhallocp; /* Current place in data heap */ -extern char *dhalloc_limit; /* GC beyond this limit */ -extern char *dhalloc_end; extern long no_gcs; /* Count the number of GC's. */ extern long no_major_gcs; /* Count the number of GC's. */ diff --git a/runtime.c b/runtime.c index 282c5c69..651598dc 100644 --- a/runtime.c +++ b/runtime.c @@ -81,28 +81,9 @@ void Cyc_check_bounds(void *data, const char *label, int len, int index) { /* Global variables. */ gc_heap *Cyc_heap; gc_thread_data *Cyc_thread; - -//TODO: get rid of globals below that are not needed -clock_t start; /* Starting time. */ -char *bottom; /* Bottom of tospace. */ -char *allocp; /* Cheney allocate pointer. */ -char *alloc_end; -/* TODO: not sure this is the best strategy for strings, especially if there - are a lot of long, later gen strings because that will cause a lot of - copying to occur during GC */ -char *dhbottom; /* Bottom of data heap */ -char *dhallocp; /* Current place in data heap */ -char *dhalloc_limit; /* GC beyond this limit */ -char *dhalloc_end; - long no_gcs = 0; /* Count the number of GC's. */ long no_major_gcs = 0; /* Count the number of GC's. */ -//TODO: after previous change, move these to thread data structure -//object gc_cont; /* GC continuation closure. */ -//object gc_ans[NUM_GC_ANS]; /* argument for GC continuation closure. */ -//int gc_num_ans; - object Cyc_global_variables = nil; int _cyc_argc = 0; char **_cyc_argv = NULL;