From: fennecdjay Date: Sun, 23 Jun 2019 12:40:41 +0000 (+0200) Subject: :art: Poolize VM_Code->name X-Git-Tag: nightly~2398 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=f02236c66605310d3226263d33c532361487b62a;p=gwion.git :art: Poolize VM_Code->name --- diff --git a/src/vm/vm_code.c b/src/vm/vm_code.c index 76078fdc..627e644c 100644 --- a/src/vm/vm_code.c +++ b/src/vm/vm_code.c @@ -35,7 +35,7 @@ ANN static void free_vm_code(VM_Code a, Gwion gwion) { memoize_end(gwion->mp, a->memoize); if(!GET_FLAG(a, builtin)) _free_code_instr(a->instr, gwion); - xfree(a->name); + free_mstr(gwion->mp, a->name); mp_free(gwion->mp , VM_Code, a); } @@ -43,7 +43,7 @@ VM_Code new_vm_code(MemPool p, const Vector instr, const m_uint stack_depth, const ae_flag flag, const m_str name) { VM_Code code = mp_calloc(p, VM_Code); code->instr = instr ? vector_copy(p, instr) : NULL; - code->name = strdup(name); + code->name = mstrdup(p, name); code->stack_depth = stack_depth; code->flag = flag; code->ref = new_refcount(p, free_vm_code);