summaryrefslogtreecommitdiffstatshomepage
path: root/py/objstringio.c
diff options
context:
space:
mode:
authorJim Mussared <jim.mussared@gmail.com>2022-04-22 17:09:15 +1000
committerDamien George <damien@micropython.org>2022-05-03 22:28:14 +1000
commit0e7bfc88c6ac6b5d64240f91183a3cfe2ab67ade (patch)
treeb578372082eb5b661263d61a1194af3868968cf9 /py/objstringio.c
parent6a3bc0e1a1f4dc0ad0b71ca0f168ad1a87d28859 (diff)
downloadmicropython-0e7bfc88c6ac6b5d64240f91183a3cfe2ab67ade.tar.gz
micropython-0e7bfc88c6ac6b5d64240f91183a3cfe2ab67ade.zip
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>
Diffstat (limited to 'py/objstringio.c')
-rw-r--r--py/objstringio.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/py/objstringio.c b/py/objstringio.c
index ef942e74e8..8b6c7531d7 100644
--- a/py/objstringio.c
+++ b/py/objstringio.c
@@ -177,8 +177,7 @@ STATIC mp_obj_t stringio___exit__(size_t n_args, const mp_obj_t *args) {
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(stringio___exit___obj, 4, 4, stringio___exit__);
STATIC mp_obj_stringio_t *stringio_new(const mp_obj_type_t *type) {
- mp_obj_stringio_t *o = m_new_obj(mp_obj_stringio_t);
- o->base.type = type;
+ mp_obj_stringio_t *o = mp_obj_malloc(mp_obj_stringio_t, type);
o->pos = 0;
o->ref_obj = MP_OBJ_NULL;
return o;