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
c30595eb
Commit
c30595eb
authored
Oct 17, 2014
by
Damien George
Browse files
py: Add more debug printing code in gc_dump_alloc_table.
parent
090c9236
Changes
1
Hide whitespace changes
Inline
Side-by-side
py/gc.c
View file @
c30595eb
...
...
@@ -696,6 +696,34 @@ void gc_dump_alloc_table(void) {
switch
(
ATB_GET_KIND
(
bl
))
{
case
AT_FREE
:
c
=
'.'
;
break
;
case
AT_HEAD
:
c
=
'h'
;
break
;
/* this prints out if the object is reachable from BSS or STACK (for unix only)
case AT_HEAD: {
extern char __bss_start, _end;
extern char *stack_top;
c = 'h';
void **ptrs = (void**)&__bss_start;
mp_uint_t len = ((mp_uint_t)&_end - (mp_uint_t)&__bss_start) / sizeof(mp_uint_t);
for (mp_uint_t i = 0; i < len; i++) {
mp_uint_t ptr = (mp_uint_t)ptrs[i];
if (VERIFY_PTR(ptr) && BLOCK_FROM_PTR(ptr) == bl) {
c = 'B';
break;
}
}
if (c == 'h') {
ptrs = (void**)&c;
len = ((mp_uint_t)stack_top - (mp_uint_t)&c) / sizeof(mp_uint_t);
for (mp_uint_t i = 0; i < len; i++) {
mp_uint_t ptr = (mp_uint_t)ptrs[i];
if (VERIFY_PTR(ptr) && BLOCK_FROM_PTR(ptr) == bl) {
c = 'S';
break;
}
}
}
break;
}
*/
/* this prints the uPy object type of the head block
case AT_HEAD: {
mp_uint_t *ptr = gc_pool_start + bl * WORDS_PER_BLOCK;
...
...
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