diff options
| author | Scott Shawcroft <scott.shawcroft@gmail.com> | 2017-02-25 12:19:33 +0100 |
|---|---|---|
| committer | Scott Shawcroft <scott.shawcroft@gmail.com> | 2017-02-26 01:00:33 +0100 |
| commit | 062fac1d43d42b35e0ecdaaec124c29b65db7c68 (patch) | |
| tree | ab2b653796caea6d368ae793e07e5382b0759bab /py/objtuple.h | |
| parent | 3fd19c60ccd879ed676bae72d42b709b34eeaa23 (diff) | |
atmel-samd: Use link time optimization to reduce code size of builds which
share space with the file system.
"Express" builds with SPI flash crash the compiler for some reason so its
currently disabled for them.
Diffstat (limited to 'py/objtuple.h')
| -rw-r--r-- | py/objtuple.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/py/objtuple.h b/py/objtuple.h index ebfc5c406..024f38a0d 100644 --- a/py/objtuple.h +++ b/py/objtuple.h @@ -36,10 +36,18 @@ typedef struct _mp_obj_tuple_t { typedef struct _mp_rom_obj_tuple_t { mp_obj_base_t base; - mp_uint_t len; + uint32_t len; mp_rom_obj_t items[]; } mp_rom_obj_tuple_t; +// This is identical to the type above except it makes it clear that there is +// only one item. This makes lto happy with the namedtuple_base_tuple. +typedef struct _mp_rom_obj_tuple1_t { + mp_obj_base_t base; + uint32_t len; + mp_rom_obj_t items[1]; +} mp_rom_obj_tuple1_t; + void mp_obj_tuple_print(const mp_print_t *print, mp_obj_t o_in, mp_print_kind_t kind); mp_obj_t mp_obj_tuple_unary_op(mp_uint_t op, mp_obj_t self_in); mp_obj_t mp_obj_tuple_binary_op(mp_uint_t op, mp_obj_t lhs, mp_obj_t rhs); |
