Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
e3f58c83
Commit
e3f58c83
authored
Apr 05, 2014
by
Paul Sokolovsky
Browse files
map: Add mp_map_dump() (#ifdef'ed) to be handy when debugging maps.
parent
c3936842
Changes
2
Hide whitespace changes
Inline
Side-by-side
py/map.c
View file @
e3f58c83
...
...
@@ -243,3 +243,17 @@ void mp_set_clear(mp_set_t *set) {
set
->
used
=
0
;
set
->
table
=
NULL
;
}
#if DEBUG_PRINT
void
mp_map_dump
(
mp_map_t
*
map
)
{
for
(
int
i
=
0
;
i
<
map
->
alloc
;
i
++
)
{
if
(
map
->
table
[
i
].
key
!=
NULL
)
{
mp_obj_print
(
map
->
table
[
i
].
key
,
PRINT_REPR
);
}
else
{
printf
(
"(nil)"
);
}
printf
(
": %p
\n
"
,
map
->
table
[
i
].
value
);
}
printf
(
"---
\n
"
);
}
#endif
py/obj.h
View file @
e3f58c83
...
...
@@ -117,6 +117,7 @@ void mp_map_deinit(mp_map_t *map);
void
mp_map_free
(
mp_map_t
*
map
);
mp_map_elem_t
*
mp_map_lookup
(
mp_map_t
*
map
,
mp_obj_t
index
,
mp_map_lookup_kind_t
lookup_kind
);
void
mp_map_clear
(
mp_map_t
*
map
);
void
mp_map_dump
(
mp_map_t
*
map
);
// Underlying set implementation (not set object)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment