Skip to content
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

[SR-9236] the tail reallocation support through tryReallocateUniquelyReferenced should work on Darwin #51724

Open
weissi opened this issue Nov 13, 2018 · 1 comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. standard library Area: Standard library umbrella

Comments

@weissi
Copy link
Member

weissi commented Nov 13, 2018

Previous ID SR-9236
Radar rdar://problem/52193379
Original Reporter @weissi
Type Bug
Additional Detail from JIRA
Votes 0
Component/s Standard Library
Labels Bug
Assignee None
Priority Medium

md5: 210af6735fe3dea175afef9063bb72ff

Issue Description:

the tail reallocation support through tryReallocateUniquelyReferenced should work on Darwin.

For reallocation to work it's important that an object isn't 'pinned' in memory or in other words can be moved around. The current support (in #19421 does make sure the object is bit-wise movable and also doesn't have a Swift side-table. Only Linux that's good enough but on Darwin (where we have the ObjC runtime) we additionally need to make sure the object doesn't have an ObjC associated object or any ObjC weak references. Unfortunately, today, there's no efficient way for the Swift runtime to check if a given instance has ObjC associated objects or weak references.

Therefore, we must conservatively assume an object is 'pinned' and hence tail reallocation doesn't work at all on Darwin (tryReallocateUniquelyReferenced will always return false).

@weissi
Copy link
Member Author

weissi commented Nov 13, 2018

@swift-ci create

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. standard library Area: Standard library umbrella
Projects
None yet
Development

No branches or pull requests

1 participant