mirror of
https://github.com/apple/swift.git
synced 2026-10-12 14:50:47 +02:00
Normally, Swift cannot import an incomplete type. However, when we are
importing a SWIFT_SHARED_REFERENCE type, we're always dealing with
pointers to the type, and there is no need for the underlying type to
be complete. This permits a common pattern in C libraries where the
actual underlying storage is opaque and all APIs traffic in the
pointer, e.g.,
typedef struct MyTypeImpl *MyType;
void MyTypeRetain(MyType ptr);
void MyTypeRelease(MyType ptr);
to use SWIFT_SHARED_REFERENCE to import such types as foreign
references, rather than as OpaquePointer.
Fixes rdar://155970441.
9 lines
137 B
Plaintext
9 lines
137 B
Plaintext
---
|
|
Name: ReferenceCounted
|
|
Tags:
|
|
- Name: OpaqueRefImpl
|
|
SwiftImportAs: reference
|
|
SwiftRetainOp: OPRetain
|
|
SwiftReleaseOp: OPRelease
|
|
|