◐ Shell
clean mode source ↗

src: use unique_ptr for scheduled delayed tasks by fhinkel · Pull Request #17083 · nodejs/node

@nodejs-github-bot added the c++

Issues and PRs that require attention from people who are familiar with C++.

label

Nov 16, 2017

addaleax

Use std::unique_ptr for delayed tasks in the scheduled
delayed tasks vector. This makes it clear that the vector
has ownership of the delayed tasks and is responsible for
deleting them.

Use a custom deleter for the pointers because libuv
needs to close the handle and then delete the data. Provide
the handle when creating the pointer instead of invoking the
special delete action everytime an element is removed from the vector.

addaleax

fhinkel added a commit that referenced this pull request

Nov 19, 2017
Use std::unique_ptr for delayed tasks in the scheduled
delayed tasks vector. This makes it clear that the vector
has ownership of the delayed tasks and is responsible for
deleting them.

Use a custom deleter for the pointers because libuv
needs to close the handle and then delete the data. Provide
the handle when creating the pointer instead of invoking the
special delete action everytime an element is removed from the vector.

PR-URL: #17083
Reviewed-By: Anna Henningsen <anna@addaleax.net>

addaleax added a commit to addaleax/node that referenced this pull request

Nov 19, 2017

addaleax added a commit that referenced this pull request

Nov 19, 2017
PR-URL: #17133
Refs: #17083
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>

MylesBorins pushed a commit that referenced this pull request

Dec 12, 2017
Use std::unique_ptr for delayed tasks in the scheduled
delayed tasks vector. This makes it clear that the vector
has ownership of the delayed tasks and is responsible for
deleting them.

Use a custom deleter for the pointers because libuv
needs to close the handle and then delete the data. Provide
the handle when creating the pointer instead of invoking the
special delete action everytime an element is removed from the vector.

PR-URL: #17083
Reviewed-By: Anna Henningsen <anna@addaleax.net>

MylesBorins pushed a commit that referenced this pull request

Dec 12, 2017
PR-URL: #17133
Refs: #17083
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>

addaleax pushed a commit to addaleax/node that referenced this pull request

May 22, 2018
Use std::unique_ptr for delayed tasks in the scheduled
delayed tasks vector. This makes it clear that the vector
has ownership of the delayed tasks and is responsible for
deleting them.

Use a custom deleter for the pointers because libuv
needs to close the handle and then delete the data. Provide
the handle when creating the pointer instead of invoking the
special delete action everytime an element is removed from the vector.

PR-URL: nodejs#17083
Reviewed-By: Anna Henningsen <anna@addaleax.net>

MylesBorins pushed a commit that referenced this pull request

Jun 14, 2018
Use std::unique_ptr for delayed tasks in the scheduled
delayed tasks vector. This makes it clear that the vector
has ownership of the delayed tasks and is responsible for
deleting them.

Use a custom deleter for the pointers because libuv
needs to close the handle and then delete the data. Provide
the handle when creating the pointer instead of invoking the
special delete action everytime an element is removed from the vector.

Backport-PR-URL: #20901
PR-URL: #17083
Reviewed-By: Anna Henningsen <anna@addaleax.net>

rvagg pushed a commit that referenced this pull request

Aug 16, 2018
Use std::unique_ptr for delayed tasks in the scheduled
delayed tasks vector. This makes it clear that the vector
has ownership of the delayed tasks and is responsible for
deleting them.

Use a custom deleter for the pointers because libuv
needs to close the handle and then delete the data. Provide
the handle when creating the pointer instead of invoking the
special delete action everytime an element is removed from the vector.

Backport-PR-URL: #20901
PR-URL: #17083
Reviewed-By: Anna Henningsen <anna@addaleax.net>