src: Modernized unique_ptr construction#31654
Closed
Yuhanun wants to merge 2 commits intonodejs:masterfrom
Yuhanun:patch-1
Closed
src: Modernized unique_ptr construction#31654Yuhanun wants to merge 2 commits intonodejs:masterfrom Yuhanun:patch-1
Yuhanun wants to merge 2 commits intonodejs:masterfrom
Yuhanun:patch-1
Conversation
addaleax
approved these changes
Feb 5, 2020
Member
addaleax
left a comment
There was a problem hiding this comment.
LGTM
Just as a side note, exceptions aren’t enabled in the Node.js source tree :)
jasnell
previously approved these changes
Feb 5, 2020
Author
Ah okay, well my bad for that :) Didn't know that, good to know though since I'm looking to make more contributions to the project :) |
Member
|
@Yuhanun It’s all good – like you said, it also makes the code more readable. 👍 |
cjihrig
approved these changes
Feb 6, 2020
TimothyGu
reviewed
Feb 6, 2020
jasnell
requested changes
Feb 6, 2020
Member
jasnell
left a comment
There was a problem hiding this comment.
Needs @TimothyGu's suggestion added
Co-Authored-By: Timothy Gu <timothygu99@gmail.com>
jasnell
approved these changes
Feb 6, 2020
devsnek
approved these changes
Feb 6, 2020
devnexen
approved these changes
Feb 6, 2020
Collaborator
fhinkel
approved these changes
Feb 6, 2020
TimothyGu
approved these changes
Feb 7, 2020
Collaborator
Member
|
Landed in 9c753b3, thanks for the PR! 🎉 |
addaleax
pushed a commit
that referenced
this pull request
Feb 8, 2020
PR-URL: #31654 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
codebytere
pushed a commit
that referenced
this pull request
Feb 17, 2020
PR-URL: #31654 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Merged
codebytere
pushed a commit
that referenced
this pull request
Mar 15, 2020
PR-URL: #31654 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
codebytere
pushed a commit
that referenced
this pull request
Mar 17, 2020
PR-URL: #31654 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Merged
codebytere
pushed a commit
that referenced
this pull request
Mar 30, 2020
PR-URL: #31654 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
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 -j4 test(UNIX), orvcbuild test(Windows) passesA simple first contribution.
std::unique_ptr's constructor can lead to memory leaks if the constructed value, allocated through
new, throws an exception or something that causes an immediate backtrace on the callstack.std::make_unique prevents this by allocating the memory for you, making it safer. Not only does it make it safer, it also makes it more readable.
I'm not sure whether I followed every guideline with this, but I hope I did.