Skip to content

Commit fc9d47c

Browse files
spevanskevints
authored andcommitted
Remove objc_retainAutoreleasedReturnValue() (swiftlang#1090)
- This was a duplicate function also provided in libdispatch. libdispatch is now a dependancy so this duplicate can be removed.
1 parent bd2a309 commit fc9d47c

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

CoreFoundation/Base.subproj/CFRuntime.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1699,15 +1699,6 @@ const char *_NSPrintForDebugger(void *cf) {
16991699
}
17001700
}
17011701

1702-
// For CF functions with 'Get' semantics, the compiler currently assumes that the result is autoreleased and must be retained. It does so on all platforms by emitting a call to objc_retainAutoreleasedReturnValue. On Darwin, this is implemented by the ObjC runtime. On Linux, there is no runtime, and therefore we have to stub it out here ourselves. The compiler will eventually call swift_release to balance the retain below. This is a workaround until the compiler no longer emits this callout on Linux.
1703-
void * objc_retainAutoreleasedReturnValue(void *obj) {
1704-
if (obj) {
1705-
swift_retain(obj);
1706-
return obj;
1707-
}
1708-
else return NULL;
1709-
}
1710-
17111702
CFHashCode __CFHashDouble(double d) {
17121703
return _CFHashDouble(d);
17131704
}

0 commit comments

Comments
 (0)