src: allow generic C++ callables in SetImmediate()#28704
Closed
addaleax wants to merge 1 commit intonodejs:masterfrom
Closed
src: allow generic C++ callables in SetImmediate()#28704addaleax wants to merge 1 commit intonodejs:masterfrom
addaleax wants to merge 1 commit intonodejs:masterfrom
Conversation
Collaborator
ff700c2 to
0386696
Compare
Collaborator
0386696 to
3cf4e25
Compare
Fishrock123
reviewed
Jul 24, 2019
src/node_perf.cc
Outdated
Contributor
There was a problem hiding this comment.
Why does this need mutable?
Member
Author
There was a problem hiding this comment.
Because here entry is moved again out of the function, and so it needs to be modifiable – Do you think a comment would help/be necessary here?
Member
Author
|
Fwiw, I requested access to CI machines for debugging in nodejs/build#1875 because I really can’t figure out why this would crash, although it’s (probably?) a problem with the relatively overseeable N-API bits here. |
Collaborator
Modify the native `SetImmediate()` functions to take generic C++ callables as arguments. This makes passing arguments to the callback easier, and in particular, it allows passing `std::unique_ptr`s directly, which in turn makes sure that the data they point to is deleted if the `Environment` is torn down before the callback can run.
6c0712f to
9d04047
Compare
Collaborator
Collaborator
Collaborator
Collaborator
Member
Author
|
CI is yellow, so I think this could use a review :) |
jasnell
approved these changes
Jul 29, 2019
Member
Author
|
Landed in 5207dec |
addaleax
added a commit
that referenced
this pull request
Jul 31, 2019
Modify the native `SetImmediate()` functions to take generic C++ callables as arguments. This makes passing arguments to the callback easier, and in particular, it allows passing `std::unique_ptr`s directly, which in turn makes sure that the data they point to is deleted if the `Environment` is torn down before the callback can run. PR-URL: #28704 Reviewed-By: James M Snell <jasnell@gmail.com>
targos
pushed a commit
that referenced
this pull request
Aug 2, 2019
Modify the native `SetImmediate()` functions to take generic C++ callables as arguments. This makes passing arguments to the callback easier, and in particular, it allows passing `std::unique_ptr`s directly, which in turn makes sure that the data they point to is deleted if the `Environment` is torn down before the callback can run. PR-URL: #28704 Reviewed-By: James M Snell <jasnell@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.
Modify the native
SetImmediate()functions to take generic C++callables as arguments. This makes passing arguments to the callback
easier, and in particular, it allows passing
std::unique_ptrsdirectly, which in turn makes sure that the data they point to is
deleted if the
Environmentis torn down before the callback can run.Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes