rename pic_gc_alloc to pic_obj_alloc
This commit is contained in:
parent
1fb9ac5d03
commit
a0556087f9
|
@ -23,7 +23,7 @@ typedef struct {
|
||||||
} pic_state;
|
} pic_state;
|
||||||
|
|
||||||
void *pic_alloc(pic_state *, size_t);
|
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 *);
|
void pic_free(pic_state *, void *);
|
||||||
|
|
||||||
pic_state *pic_open();
|
pic_state *pic_open();
|
||||||
|
|
3
src/gc.c
3
src/gc.c
|
@ -79,7 +79,7 @@ pic_free(pic_state *pic, void *ptr)
|
||||||
}
|
}
|
||||||
|
|
||||||
struct pic_object *
|
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;
|
struct pic_object *obj;
|
||||||
|
|
||||||
|
@ -88,4 +88,3 @@ pic_gc_alloc(pic_state *pic, size_t size, enum pic_tt tt)
|
||||||
|
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ pic_cons(pic_state *pic, pic_value car, pic_value cdr)
|
||||||
{
|
{
|
||||||
struct pic_pair *pair;
|
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->car = car;
|
||||||
pair->cdr = cdr;
|
pair->cdr = cdr;
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ pic_intern_cstr(pic_state *pic, const char *name)
|
||||||
struct pic_symbol *sym;
|
struct pic_symbol *sym;
|
||||||
size_t len;
|
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 */
|
/* clone name string */
|
||||||
len = strlen(name);
|
len = strlen(name);
|
||||||
|
|
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_irep *irep;
|
||||||
struct pic_code *code;
|
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));
|
proc->u.irep = irep = (struct pic_irep *)malloc(sizeof(struct pic_irep));
|
||||||
irep->code = code = (struct pic_code *)malloc(sizeof(struct pic_code) * 1024);
|
irep->code = code = (struct pic_code *)malloc(sizeof(struct pic_code) * 1024);
|
||||||
|
|
Loading…
Reference in New Issue