mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[stdlib] Switch some shims to use id
Since ObjC functions take their arguments at +0, we don't need to erase "object-ness" in order to avoid disturbing reference counts. This interacts much better with lifetime optimizations, since the caller must ensure the argument isn't released until these functions return. Swift SVN r22580
This commit is contained in:
@@ -683,9 +683,7 @@ extern "C" const char *swift_getGenericClassObjCName(const ClassMetadata *clas,
|
||||
|
||||
// Given a non-nil object reference, return true iff the object uses
|
||||
// native swift reference counting.
|
||||
bool swift::_swift_usesNativeSwiftReferenceCounting_nonNull(
|
||||
const void *object
|
||||
) {
|
||||
bool swift::_swift_usesNativeSwiftReferenceCounting_nonNull(id object) {
|
||||
assert(object != nullptr);
|
||||
#if SWIFT_OBJC_INTEROP
|
||||
return !isObjCTaggedPointer(object) &&
|
||||
@@ -697,9 +695,7 @@ bool swift::_swift_usesNativeSwiftReferenceCounting_nonNull(
|
||||
|
||||
// Given a non-nil object reference, return true iff the object is a
|
||||
// native swift object with strong reference count of 1.
|
||||
bool swift::_swift_isUniquelyReferencedNative_nonNull(
|
||||
const void* object
|
||||
) {
|
||||
bool swift::_swift_isUniquelyReferencedNative_nonNull(id object) {
|
||||
assert(object != nullptr);
|
||||
return
|
||||
#if SWIFT_OBJC_INTEROP
|
||||
|
||||
Reference in New Issue
Block a user