diff --git a/src/symbol.c b/src/symbol.c index c247de7d..e6ae8299 100644 --- a/src/symbol.c +++ b/src/symbol.c @@ -1,4 +1,5 @@ #include +#include #include "picrin.h" @@ -12,7 +13,7 @@ pic_intern_cstr(pic_state *pic, const char *name) /* clone name string */ len = strlen(name); - sym->name = (char *)pic_alloc(pic, len + 1); + sym->name = (char *)malloc(len + 1); strncpy(sym->name, name, len + 1); return pic_obj_value(sym); diff --git a/src/vm.c b/src/vm.c index 1603106b..439d9cd8 100644 --- a/src/vm.c +++ b/src/vm.c @@ -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 = pic_alloc(pic, sizeof(struct pic_proc)); + proc = (struct pic_proc *)malloc(sizeof(struct pic_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);