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

Commits on Feb 6, 2021

  1. src: use make_shared for safe allocation

    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>
    yashLadha authored and Trott committed Feb 6, 2021
    Configuration menu
    Copy the full SHA
    36cc0ee View commit details
    Browse the repository at this point in the history