From 8b0535e23fb1c646103a060a4ae17e9ee6d5e887 Mon Sep 17 00:00:00 2001 From: Damien George Date: Sat, 5 Apr 2014 21:53:54 +0100 Subject: py: Change module globals from mp_map_t* to mp_obj_dict_t*. Towards addressing issue #424. Had a small increase to ROM usage (order 60 bytes). --- py/modcollections.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'py/modcollections.c') diff --git a/py/modcollections.c b/py/modcollections.c index 3401600bb..dbd1896f2 100644 --- a/py/modcollections.c +++ b/py/modcollections.c @@ -9,16 +9,19 @@ STATIC const mp_map_elem_t mp_module_collections_globals_table[] = { { MP_OBJ_NEW_QSTR(MP_QSTR_namedtuple), (mp_obj_t)&mp_namedtuple_obj }, }; -STATIC const mp_map_t mp_module_collections_globals = { - .all_keys_are_qstrs = 1, - .table_is_fixed_array = 1, - .used = sizeof(mp_module_collections_globals_table) / sizeof(mp_map_elem_t), - .alloc = sizeof(mp_module_collections_globals_table) / sizeof(mp_map_elem_t), - .table = (mp_map_elem_t*)mp_module_collections_globals_table, +STATIC const mp_obj_dict_t mp_module_collections_globals = { + .base = {&mp_type_dict}, + .map = { + .all_keys_are_qstrs = 1, + .table_is_fixed_array = 1, + .used = sizeof(mp_module_collections_globals_table) / sizeof(mp_map_elem_t), + .alloc = sizeof(mp_module_collections_globals_table) / sizeof(mp_map_elem_t), + .table = (mp_map_elem_t*)mp_module_collections_globals_table, + }, }; const mp_obj_module_t mp_module_collections = { .base = { &mp_type_module }, .name = MP_QSTR_collections, - .globals = (mp_map_t*)&mp_module_collections_globals, + .globals = (mp_obj_dict_t*)&mp_module_collections_globals, }; -- cgit v1.2.3