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
[cxx-interop] Document the calling conventions for C++ Shared Reference Types (#748)
This is interesting for reverse interop where the Swift functions take
or return foreign reference types.
Co-authored-by: Gabor Horvath <[email protected]>
In case of the `takeSharedObject` function, the compiler will automatically insert calls to retain and release for `x` as necessary to satisfy the semantics of
1265
+
owned/guaranteed calling conventions. The C++ callers must guarantee that `x` is alive for the duration of the call.
1266
+
Note that functions returning a shared reference type such as `returnSharedObject` transfer the ownership to the caller.
1267
+
The C++ caller of this function is responsible for releasing the object.
1268
+
1252
1269
### Unsafe Reference Types
1253
1270
1254
1271
The `SWIFT_UNSAFE_REFERENCE` annotation macro has the same effect as `SWIFT_IMMORTAL_REFERENCE`
0 commit comments