mirror of
https://github.com/jerryscript-project/jerryscript.git
synced 2025-12-15 16:29:21 +00:00
add --mem-stats flag to print memory usage statistics at exit
This commit is contained in:
parent
2c85a55c85
commit
6f7e2ecdbc
11
src/main.c
11
src/main.c
@ -146,6 +146,7 @@ main (int argc __unused,
|
||||
{
|
||||
const char *file_name = NULL;
|
||||
bool parse_only = false;
|
||||
bool print_mem_stats = false;
|
||||
int i;
|
||||
|
||||
for (i = 1; i < argc; i++)
|
||||
@ -157,6 +158,10 @@ main (int argc __unused,
|
||||
__printf("Branch name:\t%s\n", JERRY_BRANCH_NAME);
|
||||
__printf("\n");
|
||||
}
|
||||
if (!__strcmp ("--mem-stats", argv[i]))
|
||||
{
|
||||
print_mem_stats = true;
|
||||
}
|
||||
else if (!__strcmp ("--parse-only", argv[i]))
|
||||
{
|
||||
parse_only = true;
|
||||
@ -181,8 +186,10 @@ main (int argc __unused,
|
||||
|
||||
jerry_run (source_p, source_size, parse_only);
|
||||
|
||||
mem_heap_print( false, false, true);
|
||||
|
||||
if (print_mem_stats)
|
||||
{
|
||||
mem_heap_print( false, false, true);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user