File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed
Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -243,3 +243,17 @@ void mp_set_clear(mp_set_t *set) {
243243 set -> used = 0 ;
244244 set -> table = NULL ;
245245}
246+
247+ #if DEBUG_PRINT
248+ void mp_map_dump (mp_map_t * map ) {
249+ for (int i = 0 ; i < map -> alloc ; i ++ ) {
250+ if (map -> table [i ].key != NULL ) {
251+ mp_obj_print (map -> table [i ].key , PRINT_REPR );
252+ } else {
253+ printf ("(nil)" );
254+ }
255+ printf (": %p\n" , map -> table [i ].value );
256+ }
257+ printf ("---\n" );
258+ }
259+ #endif
Original file line number Diff line number Diff line change @@ -117,6 +117,7 @@ void mp_map_deinit(mp_map_t *map);
117117void mp_map_free (mp_map_t * map );
118118mp_map_elem_t * mp_map_lookup (mp_map_t * map , mp_obj_t index , mp_map_lookup_kind_t lookup_kind );
119119void mp_map_clear (mp_map_t * map );
120+ void mp_map_dump (mp_map_t * map );
120121
121122// Underlying set implementation (not set object)
122123
You can’t perform that action at this time.
0 commit comments