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 /py/emitnative.c | |
| parent | 101886f5291fdbef07ba70d386c5e3e644b71cfb (diff) | |
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 'py/emitnative.c')
| -rw-r--r-- | py/emitnative.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/py/emitnative.c b/py/emitnative.c index bdb590e77..e8e3754e1 100644 --- a/py/emitnative.c +++ b/py/emitnative.c @@ -1806,6 +1806,7 @@ STATIC void emit_native_get_iter(emit_t *emit) { vtype_kind_t vtype; emit_pre_pop_reg(emit, &vtype, REG_ARG_1); assert(vtype == VTYPE_PYOBJ); + assert(0); // TODO allocate memory for iter_buf emit_call(emit, MP_F_GETITER); emit_post_push_reg(emit, VTYPE_PYOBJ, REG_RET); } |
