summaryrefslogtreecommitdiff
path: root/py/objfun.c
diff options
context:
space:
mode:
Diffstat (limited to 'py/objfun.c')
-rw-r--r--py/objfun.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/py/objfun.c b/py/objfun.c
index 3542cc0e3..0053db449 100644
--- a/py/objfun.c
+++ b/py/objfun.c
@@ -393,8 +393,7 @@ mp_obj_t mp_obj_new_fun_bc(const mp_obj_t *def_args, const byte *code, const mp_
def_kw_args = def_args[1];
n_extra_args += 1;
}
- mp_obj_fun_bc_t *o = m_new_obj_var(mp_obj_fun_bc_t, mp_obj_t, n_extra_args);
- o->base.type = &mp_type_fun_bc;
+ mp_obj_fun_bc_t *o = mp_obj_malloc_var(mp_obj_fun_bc_t, mp_obj_t, n_extra_args, &mp_type_fun_bc);
o->bytecode = code;
o->context = context;
o->child_table = child_table;
@@ -536,8 +535,7 @@ STATIC const mp_obj_type_t mp_type_fun_asm = {
};
mp_obj_t mp_obj_new_fun_asm(size_t n_args, const void *fun_data, mp_uint_t type_sig) {
- mp_obj_fun_asm_t *o = m_new_obj(mp_obj_fun_asm_t);
- o->base.type = &mp_type_fun_asm;
+ mp_obj_fun_asm_t *o = mp_obj_malloc(mp_obj_fun_asm_t, &mp_type_fun_asm);
o->n_args = n_args;
o->fun_data = fun_data;
o->type_sig = type_sig;