Skip to content

Commit

Permalink
repl: call dyld_print_stats on --print-stats
Browse files Browse the repository at this point in the history
```
=== dyld memory consumption immediately before dyld_clear ===
      <main> mod       4481 (peak       5410) inst     337768 (peak     337768)
   libfoo.so mod       3057 (peak       3341) inst        836 (peak        872)
   libbar.so mod       2384 (peak       2668) inst        660 (peak        696)
    libdl.so mod       1830 (peak       2052) inst        444 (peak        480)
     libc.so mod     191059 (peak     192831) inst      47520 (peak      47556)
   libbaz.so mod       1636 (peak       1822) inst        444 (peak        480)
```
  • Loading branch information
yamt committed Aug 5, 2024
1 parent c7a6b8c commit a035a5c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cli/repl.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,13 @@ repl_unload_u(struct repl_state *state, struct repl_module_state_u *mod_u)
#if defined(TOYWASM_ENABLE_DYLD)
if (state->opts.enable_dyld) {
struct dyld *d = &mod_u->u.dyld;
#if defined(TOYWASM_ENABLE_DYLD)
if (state->opts.print_stats) {
nbio_printf("=== dyld memory consumption immediately "
"before dyld_clear ===\n");
dyld_print_stats(d);
}
#endif
dyld_clear(d);
return;
}
Expand Down

0 comments on commit a035a5c

Please sign in to comment.