@@ -115,6 +115,8 @@ typedef enum _mp_map_lookup_kind_t {
115115 MP_MAP_LOOKUP_REMOVE_IF_FOUND , // 2
116116} mp_map_lookup_kind_t ;
117117
118+ #define MP_MAP_SLOT_IS_FILLED (map , pos ) ((map)->table[pos].key != MP_OBJ_NULL && (map)->table[pos].key != MP_OBJ_SENTINEL)
119+
118120void mp_map_init (mp_map_t * map , int n );
119121void mp_map_init_fixed_table (mp_map_t * map , int n , const mp_obj_t * table );
120122mp_map_t * mp_map_new (int n );
@@ -132,6 +134,8 @@ typedef struct _mp_set_t {
132134 mp_obj_t * table ;
133135} mp_set_t ;
134136
137+ #define MP_SET_SLOT_IS_FILLED (set , pos ) ((set)->table[pos] != MP_OBJ_NULL && (set)->table[pos] != MP_OBJ_SENTINEL)
138+
135139void mp_set_init (mp_set_t * set , int n );
136140mp_obj_t mp_set_lookup (mp_set_t * set , mp_obj_t index , mp_map_lookup_kind_t lookup_kind );
137141mp_obj_t mp_set_remove_first (mp_set_t * set );
@@ -444,6 +448,7 @@ typedef struct _mp_obj_dict_t {
444448 mp_obj_base_t base ;
445449 mp_map_t map ;
446450} mp_obj_dict_t ;
451+ void mp_obj_dict_init (mp_obj_dict_t * dict , int n_args );
447452uint mp_obj_dict_len (mp_obj_t self_in );
448453mp_obj_t mp_obj_dict_store (mp_obj_t self_in , mp_obj_t key , mp_obj_t value );
449454mp_obj_t mp_obj_dict_delete (mp_obj_t self_in , mp_obj_t key );
@@ -483,9 +488,9 @@ MP_DECLARE_CONST_FUN_OBJ(mp_identity_obj);
483488typedef struct _mp_obj_module_t {
484489 mp_obj_base_t base ;
485490 qstr name ;
486- mp_map_t * globals ;
491+ mp_obj_dict_t * globals ;
487492} mp_obj_module_t ;
488- mp_map_t * mp_obj_module_get_globals (mp_obj_t self_in );
493+ mp_obj_dict_t * mp_obj_module_get_globals (mp_obj_t self_in );
489494
490495// staticmethod and classmethod types; defined here so we can make const versions
491496// this structure is used for instances of both staticmethod and classmethod
0 commit comments