Fix Subclassed WeakReference to be GCed#3347
Merged
WojciechMazur merged 4 commits intoscala-native:mainfrom Jun 29, 2023
Merged
Fix Subclassed WeakReference to be GCed#3347WojciechMazur merged 4 commits intoscala-native:mainfrom
WeakReference to be GCed#3347WojciechMazur merged 4 commits intoscala-native:mainfrom
Conversation
tanishiking
reviewed
Jun 29, 2023
Member
tanishiking
left a comment
There was a problem hiding this comment.
I took a look at the changes (mostly for learning purposes), and it looks good to me. I can indeed confirm that this change address the specific examples mentioned in the original issue. 🎉
However, since I'm not very familiar with this particular area, I would appreciate it if someone else could review it as well 😃
| static inline bool Object_IsWeakReference(Object *object) { | ||
| return object->rtti->rt.id == __weak_ref_id; | ||
| int32_t id = object->rtti->rt.id; | ||
| return __weak_ref_ids_min <= id && id <= __weak_ref_ids_max; |
Member
There was a problem hiding this comment.
[note] range is closed set 👍
WojciechMazur
approved these changes
Jun 29, 2023
WojciechMazur
pushed a commit
to WojciechMazur/scala-native
that referenced
this pull request
Sep 1, 2023
Instead of using WeakReferenceId directly to determine WeakReference, we use the ranges of WeakReference to make the determination, as `Class.is` does. (cherry picked from commit 8c87a9a)
WojciechMazur
pushed a commit
that referenced
this pull request
Sep 4, 2023
Instead of using WeakReferenceId directly to determine WeakReference, we use the ranges of WeakReference to make the determination, as `Class.is` does. (cherry picked from commit 8c87a9a)
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.
Fix #3341
Instead of using
WeakReferenceIddirectory to determine WeakReference, we use therangesof WeakReference to make the determination, asClass.isdoes.