src: avoid manual memory management in inspector#7906
Merged
bnoordhuis merged 2 commits intonodejs:masterfrom Aug 1, 2016
Merged
src: avoid manual memory management in inspector#7906bnoordhuis merged 2 commits intonodejs:masterfrom
bnoordhuis merged 2 commits intonodejs:masterfrom
Conversation
Member
Author
src/inspector_socket.cc
Outdated
Member
There was a problem hiding this comment.
This doesn’t work on Windows, the order of the members in uv_buf_t is reversed there.
Member
Author
There was a problem hiding this comment.
Updated to use uv_buf_init(). Will run the CI again when it's back up.
70a1576 to
7885fc7
Compare
Member
Author
|
Rebased and updated: https://ci.nodejs.org/job/node-test-pull-request/3467/ |
Member
|
LGTM |
Member
|
LGTM, and CI is green |
The inspector tests weren't closing open libuv handles properly,
making valgrind complain. Strengthen the uv_loop_close() check
while here.
With this commit applied:
$ valgrind ./out/Release/cctest 2>&1 | grep 'total heap' | cut -c31-
1,017 allocs, 1,017 frees, 21,695,456 bytes allocated
PR-URL: nodejs#7906
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
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: nodejs#7906
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
7885fc7 to
c8c1f96
Compare
cjihrig
pushed a commit
that referenced
this pull request
Aug 10, 2016
The inspector tests weren't closing open libuv handles properly,
making valgrind complain. Strengthen the uv_loop_close() check
while here.
With this commit applied:
$ valgrind ./out/Release/cctest 2>&1 | grep 'total heap' | cut -c31-
1,017 allocs, 1,017 frees, 21,695,456 bytes allocated
PR-URL: #7906
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
cjihrig
pushed a commit
that referenced
this pull request
Aug 10, 2016
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>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
After:
CI: https://ci.nodejs.org/job/node-test-pull-request/3444/