Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
914bcf16
Commit
914bcf16
authored
May 31, 2014
by
Paul Sokolovsky
Browse files
unix: Add poorman's stack usage info to mem_info() dump.
parent
b30a777a
Changes
1
Hide whitespace changes
Inline
Side-by-side
unix/main.c
View file @
914bcf16
...
...
@@ -63,7 +63,7 @@ long heap_size = 128*1024 * (sizeof(machine_uint_t) / 4);
#endif
// Stack top at the start of program
void
*
stack_top
;
char
*
stack_top
;
void
microsocket_init
();
void
time_init
();
...
...
@@ -212,7 +212,10 @@ int usage(char **argv) {
}
mp_obj_t
mem_info
(
void
)
{
printf
(
"mem: total=%d, current=%d, peak=%d
\n
"
,
m_get_total_bytes_allocated
(),
m_get_current_bytes_allocated
(),
m_get_peak_bytes_allocated
());
volatile
int
stack_dummy
;
printf
(
"mem: total=%d, current=%d, peak=%d
\n
"
,
m_get_total_bytes_allocated
(),
m_get_current_bytes_allocated
(),
m_get_peak_bytes_allocated
());
printf
(
"stack: %d
\n
"
,
stack_top
-
(
char
*
)
&
stack_dummy
);
#if MICROPY_ENABLE_GC
gc_dump_info
();
#endif
...
...
@@ -258,7 +261,7 @@ void pre_process_options(int argc, char **argv) {
int
main
(
int
argc
,
char
**
argv
)
{
volatile
int
stack_dummy
;
stack_top
=
(
void
*
)
&
stack_dummy
;
stack_top
=
(
char
*
)
&
stack_dummy
;
pre_process_options
(
argc
,
argv
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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