You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[stdlib] Clean up some sources of undefined behaviour
While experimenting with forbidding temporary argument conversions for `UnsafePointer` initialiser parameters (amongst others), I found a few cases where we're currently making such unsound calls in the SDK overlays.
This commit removes such usages by performing the temporary argument conversions directly without going through any `UnsafePointer` initialiser calls first.
In the case of `MTLCopyAllDevicesWithObserver`, we were even over-releasing the observer through the usage of:
```swift
AutoreleasingUnsafeMutablePointer<NSObjectProtocol?>(&resultTuple.observer)
```
As we're treating +1 memory as having +0 semantics (this didn't appear to cause issues for users though as Metal itself appears to keep the observer retained).
0 commit comments