From 208ff140251a9cfd10e74b7180bddf5fa3db55f7 Mon Sep 17 00:00:00 2001 From: Simon Evans Date: Sat, 27 May 2017 19:30:56 +0100 Subject: [PATCH] Remove objc_retainAutoreleasedReturnValue() - This was a duplicate function also provided in libdispatch. libdispatch is now a dependancy so this duplicate can be removed. --- CoreFoundation/Base.subproj/CFRuntime.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/CoreFoundation/Base.subproj/CFRuntime.c b/CoreFoundation/Base.subproj/CFRuntime.c index d7550a4ab3..ead676d6ec 100644 --- a/CoreFoundation/Base.subproj/CFRuntime.c +++ b/CoreFoundation/Base.subproj/CFRuntime.c @@ -1699,15 +1699,6 @@ const char *_NSPrintForDebugger(void *cf) { } } -// 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. -void * objc_retainAutoreleasedReturnValue(void *obj) { - if (obj) { - swift_retain(obj); - return obj; - } - else return NULL; -} - CFHashCode __CFHashDouble(double d) { return _CFHashDouble(d); }