NSZone: implement NSMakeCollectable()

Implement NSMakeCollectable(), an interface which makes CoreFoundation
objects eligible for garbage collection.

Since garbage collection is a totally deprecated API, its implementation
is a no-op, which may cause objects that rely on it to leak. However, it
doesn't look like supporting actual garbage collection at this point
will bring a gain to the project -- and having this function available
will avoid breaking builds that rely on it.
This commit is contained in:
Daniel Ferreira 2017-06-21 10:00:25 +10:00 committed by Ivan Vučica
parent d49db3ab29
commit 8df9e6d73d

View file

@ -320,6 +320,14 @@ NSReallocateCollectable(void *ptr, NSUInteger size, NSUInteger options);
#endif
static inline id NSMakeCollectable(const void *cf) {
#if __has_feature(objc_arc)
return nil;
#else
return (id)cf; // Unimplemented; garbage collection is deprecated.
#endif
}
#if defined(__cplusplus)
}
#endif