Retain and autorelease associated objects properly #331
Merged
davidchisnall merged 3 commits intomasterfrom Mar 16, 2025
Merged
Retain and autorelease associated objects properly #331davidchisnall merged 3 commits intomasterfrom
davidchisnall merged 3 commits intomasterfrom
Conversation
Apple's objc4 runtime expands the policy bits into the following
subcategories:
```
enum {
OBJC_ASSOCIATION_SETTER_ASSIGN = 0,
OBJC_ASSOCIATION_SETTER_RETAIN = 1,
OBJC_ASSOCIATION_SETTER_COPY = 3,
OBJC_ASSOCIATION_GETTER_READ = (0 << 8),
OBJC_ASSOCIATION_GETTER_RETAIN = (1 << 8),
OBJC_ASSOCIATION_GETTER_AUTORELEASE = (2 << 8)
};
```
where
OBJC_ASSOCIATION_ASSIGN = 0
OBJC_ASSOCIATION_RETAIN_NONATOMIC = 1
OBJC_ASSOCIATION_COPY_NONATOMIC = 3
OBJC_ASSOCIATION_RETAIN = 01401
OBJC_ASSOCIATION_COPY = 01403
This means that on OBJC_ASSOCIATION_{RETAIN, COPY} and the
NONATOMIC counterpart, we need to retain and autorelease the associated
object before returning it in objc_getAssociatedObject.
Closed
davidchisnall
approved these changes
Mar 15, 2025
Member
|
The FreeBSD CI needs version bumping, can you add that s9 we can merge with clean CI? |
Member
Author
|
Do you know why |
Member
|
Yes, the GitHub branch things are different. |
Member
|
Looks like I can’t add them to the branch protection rules until the PR is merged. |
6c74c7c to
28ab03a
Compare
Member
Author
And we cannot merge the PR without the being green. But it still waits for |
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.
Apple's objc4 runtime expands the policy bits into the following
subcategories:
where
This means that on OBJC_ASSOCIATION_{RETAIN, COPY} and the
NONATOMIC counterpart, we need to retain and autorelease the associated
object before returning it in objc_getAssociatedObject.