X Tutup
The Wayback Machine - https://web.archive.org/web/20220423220038/https://github.com/nodejs/node/pull/37139
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src: use make_shared for safe allocation #37139

Merged
merged 1 commit into from Feb 6, 2021

Conversation

Copy link
Member

@yashLadha yashLadha commented Jan 30, 2021

No description provided.

@nodejs-github-bot nodejs-github-bot added the c++ label Jan 30, 2021
@nodejs-github-bot
Copy link
Contributor

@nodejs-github-bot nodejs-github-bot commented Feb 1, 2021

@yashLadha
Copy link
Member Author

@yashLadha yashLadha commented Feb 6, 2021

Can I go ahead and deploy @addaleax @jasnell @cjihrig?

Trott
Trott approved these changes Feb 6, 2021
Trott pushed a commit to yashLadha/node that referenced this issue Feb 6, 2021
Using the reset does a double allocation and is error prone if some
exception occured which is very unlikely but can happen. make_shared_ptr
gives hedge over this and handle the failure in allocation.

PR-URL: nodejs#37139
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Using the reset does a double allocation and is error prone if some
exception occured which is very unlikely but can happen. make_shared_ptr
gives hedge over this and handle the failure in allocation.

PR-URL: nodejs#37139
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
@Trott Trott merged commit 36cc0ee into nodejs:master Feb 6, 2021
@Trott
Copy link
Member

@Trott Trott commented Feb 6, 2021

Landed in 36cc0ee

danielleadams pushed a commit that referenced this issue Feb 16, 2021
Using the reset does a double allocation and is error prone if some
exception occured which is very unlikely but can happen. make_shared_ptr
gives hedge over this and handle the failure in allocation.

PR-URL: #37139
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
@danielleadams danielleadams mentioned this pull request Feb 16, 2021
@danielleadams danielleadams mentioned this pull request Feb 16, 2021
targos pushed a commit that referenced this issue May 1, 2021
Using the reset does a double allocation and is error prone if some
exception occured which is very unlikely but can happen. make_shared_ptr
gives hedge over this and handle the failure in allocation.

PR-URL: #37139
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
@danielleadams danielleadams mentioned this pull request May 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants
X Tutup