diff --git a/include/cyclone/runtime-main.h b/include/cyclone/runtime-main.h index 22808d77..dc8807c7 100644 --- a/include/cyclone/runtime-main.h +++ b/include/cyclone/runtime-main.h @@ -21,8 +21,8 @@ static void main_main(long stack_size,long heap_size,char *stack_base); static void main_main (stack_size,heap_size,stack_base) long stack_size,heap_size; char *stack_base; {char in_my_frame; - mclosure0(clos_exit,&my_exit); /* Create a closure for exit function. */ - gc_ans[0] = &clos_exit; /* It becomes the argument to test. */ + mclosure0(clos_halt,&Cyc_halt); /* Halt program if final closure is reached */ + gc_ans[0] = &clos_halt; gc_num_ans = 1; /* Allocate stack buffer. */ stack_begin = stack_base; diff --git a/include/cyclone/runtime.h b/include/cyclone/runtime.h index cbcb10ed..ee83caa3 100644 --- a/include/cyclone/runtime.h +++ b/include/cyclone/runtime.h @@ -139,7 +139,7 @@ object Cyc_command_line_arguments(object cont); integer_type Cyc_system(object cmd); integer_type Cyc_char2integer(object chr); object Cyc_integer2char(object n); -void my_exit(closure); +void Cyc_halt(closure); object __halt(object obj); port_type Cyc_stdout(void); port_type Cyc_stdin(void); diff --git a/runtime.c b/runtime.c index d70869f7..237de598 100644 --- a/runtime.c +++ b/runtime.c @@ -1176,25 +1176,17 @@ object Cyc_integer2char(object n){ return obj_char2obj(val); } -void my_exit(closure); -void my_exit(env) closure env; { +void Cyc_halt(closure); +void Cyc_halt(env) closure env; { #if DEBUG_SHOW_DIAG - printf("my_exit: heap bytes allocated=%d time=%ld ticks no_gcs=%ld no_m_gcs=%ld\n", + printf("Cyc_halt: heap bytes allocated=%d time=%ld ticks no_gcs=%ld no_m_gcs=%ld\n", allocp-bottom,clock()-start,no_gcs,no_major_gcs); - printf("my_exit: ticks/second=%ld\n",(long) CLOCKS_PER_SEC); + printf("Cyc_halt: ticks/second=%ld\n",(long) CLOCKS_PER_SEC); #endif exit(0);} object __halt(object obj) { -#if DEBUG_SHOW_DIAG - printf("\nhalt: "); - Cyc_display(obj, stdout); - printf("\n"); - printf("my_exit: heap bytes allocated=%d time=%ld ticks no_gcs=%ld no_m_gcs=%ld\n", - allocp-bottom,clock()-start,no_gcs,no_major_gcs); - printf("my_exit: ticks/second=%ld\n",(long) CLOCKS_PER_SEC); -#endif - my_exit(obj); + Cyc_halt(obj); return nil; }