irep object is now controlled under GC
This commit is contained in:
parent
586b228156
commit
11e4f1644b
|
@ -59,6 +59,7 @@ struct pic_code {
|
||||||
};
|
};
|
||||||
|
|
||||||
struct pic_irep {
|
struct pic_irep {
|
||||||
|
PIC_OBJECT_HEADER
|
||||||
struct pic_code *code;
|
struct pic_code *code;
|
||||||
size_t clen, ccapa;
|
size_t clen, ccapa;
|
||||||
int argc, localc;
|
int argc, localc;
|
||||||
|
|
|
@ -100,7 +100,7 @@ new_irep(pic_state *pic)
|
||||||
{
|
{
|
||||||
struct pic_irep *irep;
|
struct pic_irep *irep;
|
||||||
|
|
||||||
irep = (struct pic_irep *)pic_alloc(pic, sizeof(struct pic_irep));
|
irep = (struct pic_irep *)pic_obj_alloc(pic, sizeof(struct pic_irep), PIC_TT_IREP);
|
||||||
irep->code = (struct pic_code *)pic_alloc(pic, sizeof(struct pic_code) * 1024);
|
irep->code = (struct pic_code *)pic_alloc(pic, sizeof(struct pic_code) * 1024);
|
||||||
irep->clen = 0;
|
irep->clen = 0;
|
||||||
irep->ccapa = 1024;
|
irep->ccapa = 1024;
|
||||||
|
|
3
src/gc.c
3
src/gc.c
|
@ -571,6 +571,9 @@ gc_finalize_object(pic_state *pic, struct pic_object *obj)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case PIC_TT_IREP: {
|
case PIC_TT_IREP: {
|
||||||
|
struct pic_irep *irep = (struct pic_irep *)obj;
|
||||||
|
pic_free(pic, irep->code);
|
||||||
|
pic_free(pic, irep->cv_tbl);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case PIC_TT_NIL:
|
case PIC_TT_NIL:
|
||||||
|
|
Loading…
Reference in New Issue