-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
n-api: do not require JS Context for napi_async_destroy()
#27255
Conversation
This can be necessary for being able to call the function when no JS Context is on the stack, e.g. during GC. Refs: nodejs#27218
Allow the function to be called during GC, which is a common use case. Fixes: nodejs#27218
Allow the destructor to be called during GC, which is a common use case.
75cdfaf
to
66f6944
Compare
napi_async_destroy()
napi_async_destroy()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
By the way, it sounds like there may not be any more v8.x semver-minor releases. (/cc @MylesBorins @nodejs/lts) I do think that this, as a bug fix, should end up in a v10.x and v8.x release, respectively, according to the usual rules for bug fixes. However, the first commit here is technically semver-minor. So, that leaves a few options:
Any preferences? |
Landed in #27255 |
This can be necessary for being able to call the function when no JS Context is on the stack, e.g. during GC. Refs: #27218 PR-URL: #27255 Fixes: #27218 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
From the options I think 2 or 3 is the right answer. I'm ok with 2 but it does seem odd to do extra work to hide the functionality just so that it can go into a semver minor release. That is unless there is more overall work in doing a release as semver minor versus semver patch. I do know that the 'extra' work might be to discuss what other semver minors might also go in but if we could just agree that the next release would be be semver minor with this one minor plus the other 'patches' then it might not be any additional work. |
This can be necessary for being able to call the function when no JS Context is on the stack, e.g. during GC. Refs: #27218 PR-URL: #27255 Fixes: #27218 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Notable changes: * intl: * Update ICU to 64.2. This adds support for Japanese Era (Reiwa). #27361 * Fixes a bug in ICU that affected Node.js 12.0.0 in the case where `new Date().toLocaleString()` was called with a non-default locale. #27415 * C++ API: * Added an `Environment` overload of `EmitAsyncDestroy`. #27255 PR-URL: TODO
Notable changes: * intl: * Update ICU to 64.2. This adds support for Japanese Era (Reiwa). #27361 * Fixes a bug in ICU that affected Node.js 12.0.0 in the case where `new Date().toLocaleString()` was called with a non-default locale. #27415 * C++ API: * Added an overload of `EmitAsyncDestroy` that can be used during garbage collection. #27255 PR-URL: #27440
Notable changes: * intl: * Update ICU to 64.2. This adds support for Japanese Era (Reiwa). #27361 * Fixes a bug in ICU that affected Node.js 12.0.0 in the case where `new Date().toLocaleString()` was called with a non-default locale. #27415 * C++ API: * Added an overload of `EmitAsyncDestroy` that can be used during garbage collection. #27255 PR-URL: #27440
src: add
Environment
overload ofEmitAsyncDestroy
This can be necessary for being able to call the function when no
JS Context is on the stack, e.g. during GC.
(This is technically semver-minor.)
n-api: do not require JS Context for
napi_async_destroy()
Allow the function to be called during GC, which is a common use case.
Fixes: #27218
/cc @nodejs/n-api
src: do not require JS Context for
~AsyncResoure()
Allow the destructor to be called during GC, which is a common use case.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes