summaryrefslogtreecommitdiffstatshomepage
path: root/tests/extmod/uasyncio_heaplock.py
diff options
context:
space:
mode:
authorJim Mussared <jim.mussared@gmail.com>2022-04-22 15:32:22 +1000
committerDamien George <damien@micropython.org>2022-05-03 22:23:46 +1000
commit709e8328d9812a2e02da6fba65a03f9a873d60a2 (patch)
tree72d53933f3e251be477f709ad3d94a2609b85fcd /tests/extmod/uasyncio_heaplock.py
parent590de399f01cd08aa4825b26b91785e07abcf68c (diff)
downloadmicropython-709e8328d9812a2e02da6fba65a03f9a873d60a2.tar.gz
micropython-709e8328d9812a2e02da6fba65a03f9a873d60a2.zip
py/obj: Introduce mp_obj_malloc macro to allocate, and set object type.
This is to replace the following: mp_foo_obj_t *self = m_new_obj(mp_foo_obj_t); self->base.type = &mp_type_foo; with: mp_foo_obj_t *self = mp_obj_malloc(mp_foo_obj_t, &mp_type_foo); Calling the function is less code than inlining setting the type everywhere, adds up to ~100 bytes on PYBV11. It also helps to avoid an easy mistake of forgetting to set the type. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Diffstat (limited to 'tests/extmod/uasyncio_heaplock.py')
0 files changed, 0 insertions, 0 deletions