src: avoid manual memory management in inspector · nodejs/node@9d45569 · GitHub
Skip to content

Commit 9d45569

Browse files
bnoordhuiscjihrig
authored andcommitted
src: avoid manual memory management in inspector
Make the inspector code easier to reason about by restructuring it to avoid manual memory allocation and copying as much as possible. An amusing side effect is that it reduces the total amount of memory used in the test suite. Before: $ valgrind ./out/Release/cctest 2>&1 | grep 'total heap' | cut -c31- 1,017 allocs, 1,017 frees, 21,695,456 allocated After: $ valgrind ./out/Release/cctest 2>&1 | grep 'total heap' | cut -c31- 869 allocs, 869 frees, 14,484,641 bytes allocated PR-URL: #7906 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent c565c17 commit 9d45569

4 files changed

Lines changed: 161 additions & 228 deletions

File tree

src/inspector_agent.cc

Lines changed: 14 additions & 17 deletions

0 commit comments

Comments
 (0)