diff options
author | Damien George <damien.p.george@gmail.com> | 2016-01-09 23:14:54 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2017-02-16 18:38:06 +1100 |
commit | ae8d86758631e62466a55d179897d2111c3cb1c1 (patch) | |
tree | 1852733b57cd4334727203e11d5af76243615636 /unix/moduselect.c | |
parent | 101886f5291fdbef07ba70d386c5e3e644b71cfb (diff) | |
download | micropython-ae8d86758631e62466a55d179897d2111c3cb1c1.tar.gz micropython-ae8d86758631e62466a55d179897d2111c3cb1c1.zip |
py: Add iter_buf to getiter type method.
Allows to iterate over the following without allocating on the heap:
- tuple
- list
- string, bytes
- bytearray, array
- dict (not dict.keys, dict.values, dict.items)
- set, frozenset
Allows to call the following without heap memory:
- all, any, min, max, sum
TODO: still need to allocate stack memory in bytecode for iter_buf.
Diffstat (limited to 'unix/moduselect.c')
-rw-r--r-- | unix/moduselect.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/unix/moduselect.c b/unix/moduselect.c index f966efa412..76938329fc 100644 --- a/unix/moduselect.c +++ b/unix/moduselect.c @@ -288,7 +288,7 @@ STATIC MP_DEFINE_CONST_DICT(poll_locals_dict, poll_locals_dict_table); STATIC const mp_obj_type_t mp_type_poll = { { &mp_type_type }, .name = MP_QSTR_poll, - .getiter = mp_identity, + .getiter = mp_identity_getiter, .iternext = poll_iternext, .locals_dict = (void*)&poll_locals_dict, }; |