This commit is contained in:
Justin Ethier 2015-08-25 22:36:05 -04:00
parent 1ac1372c8e
commit 6f165aeb33
3 changed files with 8 additions and 16 deletions

View file

@ -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) static void main_main (stack_size,heap_size,stack_base)
long stack_size,heap_size; char *stack_base; long stack_size,heap_size; char *stack_base;
{char in_my_frame; {char in_my_frame;
mclosure0(clos_exit,&my_exit); /* Create a closure for exit function. */ mclosure0(clos_halt,&Cyc_halt); /* Halt program if final closure is reached */
gc_ans[0] = &clos_exit; /* It becomes the argument to test. */ gc_ans[0] = &clos_halt;
gc_num_ans = 1; gc_num_ans = 1;
/* Allocate stack buffer. */ /* Allocate stack buffer. */
stack_begin = stack_base; stack_begin = stack_base;

View file

@ -139,7 +139,7 @@ object Cyc_command_line_arguments(object cont);
integer_type Cyc_system(object cmd); integer_type Cyc_system(object cmd);
integer_type Cyc_char2integer(object chr); integer_type Cyc_char2integer(object chr);
object Cyc_integer2char(object n); object Cyc_integer2char(object n);
void my_exit(closure); void Cyc_halt(closure);
object __halt(object obj); object __halt(object obj);
port_type Cyc_stdout(void); port_type Cyc_stdout(void);
port_type Cyc_stdin(void); port_type Cyc_stdin(void);

View file

@ -1176,25 +1176,17 @@ object Cyc_integer2char(object n){
return obj_char2obj(val); return obj_char2obj(val);
} }
void my_exit(closure); void Cyc_halt(closure);
void my_exit(env) closure env; { void Cyc_halt(env) closure env; {
#if DEBUG_SHOW_DIAG #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); 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 #endif
exit(0);} exit(0);}
object __halt(object obj) { object __halt(object obj) {
#if DEBUG_SHOW_DIAG Cyc_halt(obj);
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);
return nil; return nil;
} }