runtime: Simple wrappers to skip objc refcounts

Swift SVN r22410
This commit is contained in:
Graham Batty
2014-09-30 22:31:59 +00:00
parent 073af87f3c
commit ed46e650f3
2 changed files with 138 additions and 14 deletions

View File

@@ -797,11 +797,7 @@ static bool _dynamicCastUnknownClass(OpaqueValue *dest,
*destSlot = result;
if (!(flags & DynamicCastFlags::TakeOnSuccess)) {
#if SWIFT_OBJC_INTEROP
swift_unknownRetain(result);
#else
swift_retain(result);
#endif
}
return true;
}
@@ -814,11 +810,7 @@ static bool _dynamicCastUnknownClass(OpaqueValue *dest,
// If the cast failed, destroy the input and return false.
if (!result) {
if (flags & DynamicCastFlags::DestroyOnFailure) {
#if SWIFT_OBJC_INTEROP
swift_unknownRelease(object);
#else
swift_release(object);
#endif
}
return false;
}
@@ -826,11 +818,7 @@ static bool _dynamicCastUnknownClass(OpaqueValue *dest,
// Otherwise, store to the destination and return true.
*destSlot = result;
if (!(flags & DynamicCastFlags::TakeOnSuccess)) {
#if SWIFT_OBJC_INTEROP
swift_unknownRetain(result);
#else
swift_retain(result);
#endif
}
return true;
}