src: re-implement the C++ WeakReference class with JS WeakRef#49053
Closed
joyeecheung wants to merge 3 commits intonodejs:mainfrom
Closed
src: re-implement the C++ WeakReference class with JS WeakRef#49053joyeecheung wants to merge 3 commits intonodejs:mainfrom
joyeecheung wants to merge 3 commits intonodejs:mainfrom
Conversation
Collaborator
|
Review requested:
|
07ea1d6 to
d62bec6
Compare
addaleax
approved these changes
Aug 7, 2023
anonrig
approved these changes
Aug 7, 2023
bakkot
reviewed
Aug 8, 2023
RafaelGSS
approved these changes
Aug 11, 2023
Member
RafaelGSS
left a comment
There was a problem hiding this comment.
That's awesome. I'm wondering if this should have an impact on memory performance. Possibly a good impact due to the removal of bridge communication?
Member
Author
Reducing the number of GC roots can be a positive thing but I don't expect much difference in this regard, considering we don't normally create that many WeakReference internally anyway (unless the user uses domain heavily, but domain has long been deprecated) |
Member
Author
|
Rebased to resolve conflict |
Collaborator
Collaborator
benjamingr
approved these changes
Aug 14, 2023
22 tasks
Collaborator
Previously we assume that the objects are GC'ed after one global.gc() returns, which is not necessarily always the case. Use gcUntil() to run GC multiple times if they are not GC'ed in the first time around.
The C++ implementation can now be done entirely in JS using WeakRef. Re-implement it in JS instead to simplify the code.
Member
Author
|
Rebased again to resolve conflict.. |
Collaborator
24 tasks
Collaborator
benjamingr
approved these changes
Aug 16, 2023
joyeecheung
added a commit
that referenced
this pull request
Aug 16, 2023
Previously we assume that the objects are GC'ed after one global.gc() returns, which is not necessarily always the case. Use gcUntil() to run GC multiple times if they are not GC'ed in the first time around. PR-URL: #49053 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
joyeecheung
added a commit
that referenced
this pull request
Aug 16, 2023
The C++ implementation can now be done entirely in JS using WeakRef. Re-implement it in JS instead to simplify the code. PR-URL: #49053 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
joyeecheung
added a commit
that referenced
this pull request
Aug 16, 2023
PR-URL: #49053 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Member
Author
|
Landed in 7215176...a49bc4b |
26 tasks
UlisesGascon
pushed a commit
that referenced
this pull request
Sep 10, 2023
Previously we assume that the objects are GC'ed after one global.gc() returns, which is not necessarily always the case. Use gcUntil() to run GC multiple times if they are not GC'ed in the first time around. PR-URL: #49053 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
UlisesGascon
pushed a commit
that referenced
this pull request
Sep 10, 2023
The C++ implementation can now be done entirely in JS using WeakRef. Re-implement it in JS instead to simplify the code. PR-URL: #49053 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
UlisesGascon
pushed a commit
that referenced
this pull request
Sep 10, 2023
PR-URL: #49053 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Merged
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.
test: make WeakReference tests robust
Previously we assume that the objects are GC'ed after one
global.gc() returns, which is not necessarily always the case. Use
gcUntil() to run GC multiple times if they are not GC'ed in the
first time around.
lib: implement WeakReference on top of JS WeakRef
The C++ implementation can now be done entirely in JS using WeakRef.
Re-implement it in JS instead to simplify the code.
src: remove C++ WeakReference implementation