let pic_proc be a first class object

This commit is contained in:
Yuichi Nishiwaki
2013-10-13 16:16:13 +09:00
parent d92bd71293
commit 1fb9ac5d03
3 changed files with 11 additions and 8 deletions
+1 -1
View File
@@ -161,7 +161,7 @@ pic_codegen(pic_state *pic, pic_value obj, struct pic_env *env)
struct pic_irep *irep;
struct pic_code *code;
proc = (struct pic_proc *)malloc(sizeof(struct pic_proc));
proc = (struct pic_proc *)pic_gc_alloc(pic, sizeof(struct pic_proc), PIC_TT_PROC);
proc->u.irep = irep = (struct pic_irep *)malloc(sizeof(struct pic_irep));
irep->code = code = (struct pic_code *)malloc(sizeof(struct pic_code) * 1024);