diff --git a/include/picrin.h b/include/picrin.h index ec469abe..6eafba52 100644 --- a/include/picrin.h +++ b/include/picrin.h @@ -23,7 +23,7 @@ typedef struct { } pic_state; void *pic_alloc(pic_state *, size_t); -struct pic_object *pic_gc_alloc(pic_state *, size_t, enum pic_tt); +struct pic_object *pic_obj_alloc(pic_state *, size_t, enum pic_tt); void pic_free(pic_state *, void *); pic_state *pic_open(); diff --git a/src/gc.c b/src/gc.c index 049a4973..8e7f0caf 100644 --- a/src/gc.c +++ b/src/gc.c @@ -79,7 +79,7 @@ pic_free(pic_state *pic, void *ptr) } struct pic_object * -pic_gc_alloc(pic_state *pic, size_t size, enum pic_tt tt) +pic_obj_alloc(pic_state *pic, size_t size, enum pic_tt tt) { struct pic_object *obj; @@ -88,4 +88,3 @@ pic_gc_alloc(pic_state *pic, size_t size, enum pic_tt tt) return obj; } - diff --git a/src/pair.c b/src/pair.c index dcb9d202..18d6839e 100644 --- a/src/pair.c +++ b/src/pair.c @@ -5,7 +5,7 @@ pic_cons(pic_state *pic, pic_value car, pic_value cdr) { struct pic_pair *pair; - pair = (struct pic_pair *)pic_gc_alloc(pic, sizeof(struct pic_pair), PIC_TT_PAIR); + pair = (struct pic_pair *)pic_obj_alloc(pic, sizeof(struct pic_pair), PIC_TT_PAIR); pair->car = car; pair->cdr = cdr; diff --git a/src/symbol.c b/src/symbol.c index e6ae8299..fcab59db 100644 --- a/src/symbol.c +++ b/src/symbol.c @@ -9,7 +9,7 @@ pic_intern_cstr(pic_state *pic, const char *name) struct pic_symbol *sym; size_t len; - sym = (struct pic_symbol*)pic_gc_alloc(pic, sizeof(struct pic_symbol), PIC_TT_SYMBOL); + sym = (struct pic_symbol*)pic_obj_alloc(pic, sizeof(struct pic_symbol), PIC_TT_SYMBOL); /* clone name string */ len = strlen(name); diff --git a/src/vm.c b/src/vm.c index 3d5e8c31..d8395df2 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 = (struct pic_proc *)pic_gc_alloc(pic, sizeof(struct pic_proc), PIC_TT_PROC); + proc = (struct pic_proc *)pic_obj_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);