arena stash can be statically allocated
This commit is contained in:
parent
6b742a7fa3
commit
c22f566c06
|
@ -16,7 +16,7 @@ struct pic_cont {
|
||||||
pic_callinfo *ci, *ci_ptr;
|
pic_callinfo *ci, *ci_ptr;
|
||||||
size_t ci_len;
|
size_t ci_len;
|
||||||
|
|
||||||
struct pic_object **arena;
|
struct pic_object *arena[PIC_ARENA_SIZE];
|
||||||
int arena_idx;
|
int arena_idx;
|
||||||
|
|
||||||
pic_value result;
|
pic_value result;
|
||||||
|
|
|
@ -47,7 +47,6 @@ save_cont(pic_state *pic)
|
||||||
cont->ci_ptr = (pic_callinfo *)pic_alloc(pic, sizeof(pic_callinfo) * cont->ci_len);
|
cont->ci_ptr = (pic_callinfo *)pic_alloc(pic, sizeof(pic_callinfo) * cont->ci_len);
|
||||||
memcpy(cont->ci_ptr, pic->cibase, sizeof(pic_callinfo) * cont->ci_len);
|
memcpy(cont->ci_ptr, pic->cibase, sizeof(pic_callinfo) * cont->ci_len);
|
||||||
|
|
||||||
cont->arena = (struct pic_object **)pic_alloc(pic, sizeof(struct pic_object *) * PIC_ARENA_SIZE);
|
|
||||||
cont->arena_idx = pic->arena_idx;
|
cont->arena_idx = pic->arena_idx;
|
||||||
memcpy(cont->arena, pic->arena, sizeof(struct pic_object *) * PIC_ARENA_SIZE);
|
memcpy(cont->arena, pic->arena, sizeof(struct pic_object *) * PIC_ARENA_SIZE);
|
||||||
|
|
||||||
|
|
1
src/gc.c
1
src/gc.c
|
@ -336,7 +336,6 @@ gc_finalize_object(pic_state *pic, struct pic_object *obj)
|
||||||
pic_free(pic, cont->stk_ptr);
|
pic_free(pic, cont->stk_ptr);
|
||||||
pic_free(pic, cont->st_ptr);
|
pic_free(pic, cont->st_ptr);
|
||||||
pic_free(pic, cont->ci_ptr);
|
pic_free(pic, cont->ci_ptr);
|
||||||
pic_free(pic, cont->arena);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case PIC_TT_NIL:
|
case PIC_TT_NIL:
|
||||||
|
|
Loading…
Reference in New Issue