pic->irep is a root marker
This commit is contained in:
parent
11e4f1644b
commit
42c097a91f
|
@ -316,6 +316,9 @@ codegen(codegen_state *state, pic_value obj, bool tailpos)
|
||||||
irep->code[irep->clen].u.i = k;
|
irep->code[irep->clen].u.i = k;
|
||||||
irep->clen++;
|
irep->clen++;
|
||||||
|
|
||||||
|
/* prevent GC from hanging */
|
||||||
|
pic->irep[k] = NULL;
|
||||||
|
|
||||||
pic->irep[k] = codegen_lambda(state, obj);
|
pic->irep[k] = codegen_lambda(state, obj);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
6
src/gc.c
6
src/gc.c
|
@ -492,6 +492,12 @@ gc_mark_phase(pic_state *pic)
|
||||||
gc_mark(pic, pic->globals[i]);
|
gc_mark(pic, pic->globals[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* irep */
|
||||||
|
for (i = 0; i < pic->ilen; ++i) {
|
||||||
|
if (pic->irep[i])
|
||||||
|
gc_mark_object(pic, (struct pic_object *)pic->irep[i]);
|
||||||
|
}
|
||||||
|
|
||||||
/* pool */
|
/* pool */
|
||||||
for (i = 0; i < pic->plen; ++i) {
|
for (i = 0; i < pic->plen; ++i) {
|
||||||
gc_mark(pic, pic->pool[i]);
|
gc_mark(pic, pic->pool[i]);
|
||||||
|
|
Loading…
Reference in New Issue