From 6c82cfc089466f0b3f4b61c81baee1cabece1eaa Mon Sep 17 00:00:00 2001 From: Damien George Date: Wed, 4 Oct 2017 11:31:05 +1100 Subject: py/objtype: Change type of enum-to-qstr table to uint16_t to save space. Qstr values fit in 16-bits (and this fact is used elsewhere in the code) so no need to use more than that for the large lookup tables. The compiler will anyway give a warning if the qstr values don't fit in 16 bits. Saves around 80 bytes of code space for Thumb2 archs. --- py/runtime.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'py/runtime.h') diff --git a/py/runtime.h b/py/runtime.h index bbdd7647e..da12f8f04 100644 --- a/py/runtime.h +++ b/py/runtime.h @@ -57,9 +57,9 @@ typedef struct _mp_arg_t { mp_arg_val_t defval; } mp_arg_t; -// defined in objtype.c -extern const qstr mp_unary_op_method_name[]; -extern const qstr mp_binary_op_method_name[]; +// Tables mapping operator enums to qstrs, defined in objtype.c +extern const uint16_t mp_unary_op_method_name[]; +extern const uint16_t mp_binary_op_method_name[]; void mp_init(void); void mp_deinit(void); -- cgit v1.2.3