diff --git a/runtime/ikarus b/runtime/ikarus index e179f43..3b1e10f 100755 Binary files a/runtime/ikarus and b/runtime/ikarus differ diff --git a/runtime/ikarus-collect.c b/runtime/ikarus-collect.c index b140c06..409cafc 100644 --- a/runtime/ikarus-collect.c +++ b/runtime/ikarus-collect.c @@ -305,8 +305,9 @@ ik_collect(int req, ikpcb* pcb){ */ scan_dirty_pages(&gc); collect_stack(&gc, pcb->frame_pointer, pcb->frame_base - wordsize); - pcb->next_k = add_object(&gc, pcb->next_k, "main"); - pcb->oblist = add_object(&gc, pcb->oblist, "main"); + pcb->next_k = add_object(&gc, pcb->next_k, "next_k"); + pcb->oblist = add_object(&gc, pcb->oblist, "oblist"); + pcb->arg_list = add_object(&gc, pcb->arg_list, "args_list"); /* now we trace all live objects */ collect_loop(&gc); diff --git a/runtime/ikarus-main.c b/runtime/ikarus-main.c index e299b7e..8aecbae 100644 --- a/runtime/ikarus-main.c +++ b/runtime/ikarus-main.c @@ -54,12 +54,6 @@ int main(int argc, char** argv){ x = stpcpy(x, argv[0]); x = stpcpy(x, ".boot"); } - if(argc != 1){ - fprintf(stderr, - "Error ~s: unrecognized argument %s\n", - argv[0], argv[1]); - exit(-1); - } if(sizeof(mp_limb_t) != sizeof(int)){ fprintf(stderr, "ERROR: limb size\n"); @@ -68,6 +62,23 @@ int main(int argc, char** argv){ fprintf(stderr, "ERROR: bits_per_limb=%d\n", mp_bits_per_limb); } ikpcb* pcb = ik_make_pcb(); + { /* set up arg_list */ + ikp arg_list = null_object; + int i = argc-1; + while(i > 0){ + char* s = argv[i]; + int n = strlen(s); + ikp str = ik_alloc(pcb, align(n+disp_string_data+1)); + ref(str, disp_string_length) = fix(n); + strcpy((char*)str+disp_string_data, s); + ikp p = ik_alloc(pcb, pair_size); + ref(p, disp_car) = str + string_tag; + ref(p, disp_cdr) = arg_list; + arg_list = p+pair_tag; + i--; + } + pcb->arg_list = arg_list; + } ik_fasl_load(pcb, boot_file); /* fprintf(stderr, "collect time: %d.%03d utime, %d.%03d stime (%d collections)\n", diff --git a/runtime/ikarus.h b/runtime/ikarus.h index d3690e2..fa97ef5 100644 --- a/runtime/ikarus.h +++ b/runtime/ikarus.h @@ -85,7 +85,7 @@ typedef struct { ikp next_k; /* offset = 20 */ void* system_stack; /* offset = 24 */ unsigned int* dirty_vector; /* offset = 28 */ - + ikp arg_list; /* offset = 32 */ /* the rest are not used by any scheme code */ /* they only support the runtime system (gc, etc.) */ unsigned int* segment_vector;