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
@@ -533,9 +533,8 @@ STATIC mp_obj_t machine_i2s_make_new(const mp_obj_type_t *type, size_t n_pos_arg
|
||||
|
||||
machine_i2s_obj_t *self;
|
||||
if (MP_STATE_PORT(machine_i2s_obj)[port] == NULL) {
|
||||
self = m_new_obj(machine_i2s_obj_t);
|
||||
self = mp_obj_malloc(machine_i2s_obj_t, &machine_i2s_type);
|
||||
MP_STATE_PORT(machine_i2s_obj)[port] = self;
|
||||
self->base.type = &machine_i2s_type;
|
||||
self->port = port;
|
||||
} else {
|
||||
self = MP_STATE_PORT(machine_i2s_obj)[port];
|
||||
|
||||
Reference in New Issue
Block a user