use C malloc instead of pic_alloc
This commit is contained in:
parent
e3600a65c9
commit
c250d3b07f
|
@ -1,4 +1,5 @@
|
|||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#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);
|
||||
|
|
2
src/vm.c
2
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);
|
||||
|
|
Loading…
Reference in New Issue