From c250d3b07f143c1e0802801a129fb9419d1b26ef Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Sun, 13 Oct 2013 16:01:40 +0900 Subject: [PATCH] use C malloc instead of pic_alloc --- src/symbol.c | 3 ++- src/vm.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) 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);