all: Use mp_obj_malloc everywhere it's applicable.
This replaces occurences of
foo_t *foo = m_new_obj(foo_t);
foo->base.type = &foo_type;
with
foo_t *foo = mp_obj_malloc(foo_t, &foo_type);
Excludes any places where base is a sub-field or when new0/memset is used.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
This commit is contained in:
committed by
Damien George
parent
6a3bc0e1a1
commit
0e7bfc88c6
@@ -108,8 +108,7 @@ STATIC const mp_obj_type_t mp_type_bound_meth = {
|
||||
};
|
||||
|
||||
mp_obj_t mp_obj_new_bound_meth(mp_obj_t meth, mp_obj_t self) {
|
||||
mp_obj_bound_meth_t *o = m_new_obj(mp_obj_bound_meth_t);
|
||||
o->base.type = &mp_type_bound_meth;
|
||||
mp_obj_bound_meth_t *o = mp_obj_malloc(mp_obj_bound_meth_t, &mp_type_bound_meth);
|
||||
o->meth = meth;
|
||||
o->self = self;
|
||||
return MP_OBJ_FROM_PTR(o);
|
||||
|
||||
Reference in New Issue
Block a user