pic->rescue is no longer used
This commit is contained in:
parent
8451bd5c19
commit
1821039e78
|
@ -77,9 +77,6 @@ typedef struct {
|
|||
|
||||
pic_code *ip;
|
||||
|
||||
struct pic_proc **rescue;
|
||||
size_t ridx, rlen;
|
||||
|
||||
pic_sym sDEFINE, sLAMBDA, sIF, sBEGIN, sQUOTE, sSETBANG;
|
||||
pic_sym sQUASIQUOTE, sUNQUOTE, sUNQUOTE_SPLICING;
|
||||
pic_sym sDEFINE_SYNTAX, sDEFINE_MACRO;
|
||||
|
|
|
@ -26,9 +26,6 @@ struct pic_cont {
|
|||
|
||||
pic_code *ip;
|
||||
|
||||
struct pic_proc **rescue;
|
||||
size_t ridx, rlen;
|
||||
|
||||
struct pic_object *arena[PIC_ARENA_SIZE];
|
||||
int arena_idx;
|
||||
|
||||
|
|
10
src/cont.c
10
src/cont.c
|
@ -119,11 +119,6 @@ save_cont(pic_state *pic, struct pic_cont **c)
|
|||
|
||||
cont->ip = pic->ip;
|
||||
|
||||
cont->ridx = pic->ridx;
|
||||
cont->rlen = pic->rlen;
|
||||
cont->rescue = (struct pic_proc **)pic_alloc(pic, sizeof(struct pic_proc *) * cont->rlen);
|
||||
memcpy(cont->rescue, pic->rescue, sizeof(struct pic_proc *) * cont->rlen);
|
||||
|
||||
cont->arena_idx = pic->arena_idx;
|
||||
memcpy(cont->arena, pic->arena, sizeof(struct pic_object *) * PIC_ARENA_SIZE);
|
||||
|
||||
|
@ -168,11 +163,6 @@ restore_cont(pic_state *pic, struct pic_cont *cont)
|
|||
|
||||
pic->ip = cont->ip;
|
||||
|
||||
pic->rescue = (struct pic_proc **)pic_realloc(pic, pic->rescue, sizeof(struct pic_proc *) * cont->rlen);
|
||||
memcpy(pic->rescue, cont->rescue, sizeof(struct pic_object *) * cont->rlen);
|
||||
pic->ridx = cont->ridx;
|
||||
pic->rlen = cont->rlen;
|
||||
|
||||
memcpy(pic->arena, cont->arena, sizeof(struct pic_object *) * PIC_ARENA_SIZE);
|
||||
pic->arena_idx = cont->arena_idx;
|
||||
|
||||
|
|
18
src/gc.c
18
src/gc.c
|
@ -406,8 +406,7 @@ gc_mark_object(pic_state *pic, struct pic_object *obj)
|
|||
struct pic_cont *cont = (struct pic_cont *)obj;
|
||||
pic_value *stack;
|
||||
pic_callinfo *ci;
|
||||
size_t i;
|
||||
int j;
|
||||
int i;
|
||||
|
||||
/* block */
|
||||
gc_mark_block(pic, cont->blk);
|
||||
|
@ -424,14 +423,9 @@ gc_mark_object(pic_state *pic, struct pic_object *obj)
|
|||
}
|
||||
}
|
||||
|
||||
/* exception handlers */
|
||||
for (i = 0; i < cont->ridx; ++i) {
|
||||
gc_mark_object(pic, (struct pic_object *)cont->rescue[i]);
|
||||
}
|
||||
|
||||
/* arena */
|
||||
for (j = 0; j < cont->arena_idx; ++j) {
|
||||
gc_mark_object(pic, cont->arena[j]);
|
||||
for (i = 0; i < cont->arena_idx; ++i) {
|
||||
gc_mark_object(pic, cont->arena[i]);
|
||||
}
|
||||
|
||||
/* result values */
|
||||
|
@ -537,11 +531,6 @@ gc_mark_phase(pic_state *pic)
|
|||
}
|
||||
}
|
||||
|
||||
/* exception handlers */
|
||||
for (i = 0; i < pic->ridx; ++i) {
|
||||
gc_mark_object(pic, (struct pic_object *)pic->rescue[i]);
|
||||
}
|
||||
|
||||
/* error object */
|
||||
if (pic->err) {
|
||||
gc_mark_object(pic, (struct pic_object *)pic->err);
|
||||
|
@ -608,7 +597,6 @@ gc_finalize_object(pic_state *pic, struct pic_object *obj)
|
|||
pic_free(pic, cont->stk_ptr);
|
||||
pic_free(pic, cont->st_ptr);
|
||||
pic_free(pic, cont->ci_ptr);
|
||||
pic_free(pic, cont->rescue);
|
||||
PIC_BLK_DECREF(pic, cont->blk);
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -42,11 +42,6 @@ pic_open(int argc, char *argv[], char **envp)
|
|||
pic->cibase = pic->ci = (pic_callinfo *)calloc(PIC_STACK_SIZE, sizeof(pic_callinfo));
|
||||
pic->ciend = pic->cibase + PIC_STACK_SIZE;
|
||||
|
||||
/* exception handlers */
|
||||
pic->rescue = (struct pic_proc **)calloc(PIC_RESCUE_SIZE, sizeof(struct pic_proc *));
|
||||
pic->ridx = 0;
|
||||
pic->rlen = PIC_RESCUE_SIZE;
|
||||
|
||||
/* memory heap */
|
||||
pic->heap = pic_heap_open();
|
||||
|
||||
|
@ -136,7 +131,6 @@ pic_close(pic_state *pic)
|
|||
/* clear out root objects */
|
||||
pic->sp = pic->stbase;
|
||||
pic->ci = pic->cibase;
|
||||
pic->ridx = 0;
|
||||
pic->arena_idx = 0;
|
||||
pic->err = NULL;
|
||||
pic->glen = 0;
|
||||
|
@ -152,7 +146,6 @@ pic_close(pic_state *pic)
|
|||
/* free runtime context */
|
||||
free(pic->stbase);
|
||||
free(pic->cibase);
|
||||
free(pic->rescue);
|
||||
|
||||
/* free global stacks */
|
||||
free(pic->globals);
|
||||
|
|
Loading…
Reference in New Issue