-
-
Notifications
You must be signed in to change notification settings - Fork 31.4k
[wip] node-api: optimize finalizer queue using container swap #57861
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
base: main
Are you sure you want to change the base?
[wip] node-api: optimize finalizer queue using container swap #57861
Conversation
Review requested:
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #57861 +/- ##
==========================================
+ Coverage 90.23% 90.26% +0.02%
==========================================
Files 630 630
Lines 185518 186170 +652
Branches 36369 36480 +111
==========================================
+ Hits 167401 168044 +643
+ Misses 11005 10984 -21
- Partials 7112 7142 +30
🚀 New features to boost your workflow:
|
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.
The assumption in the comment "userland code can delete additional references in one finalizer" will break with the new change.
However, this assumption was not reflected in test test/js-native-api/6_object_wrap/6_object_wrap.cc
. Would you mind updating the test to verify deleting another reference in the destructor of MyObject
?
MyObject::~MyObject() {
napi_delete_reference(env_, nested_);
napi_delete_reference(env_, wrapper_);
}
I updated, thanks |
tests passed in my local environment for macos but I think there is a problem in linux I will try |
#57861 (review) was not addressed. The change proposed does not fulfill the behavior as described in the original comment: Lines 116 to 118 in 68cc1c9
This change will crash the test #57981. |
thanks I updated it as you indicated here |
I replaced the iterative per-item removal with a swap to reduce the overhead