mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 17:10:48 +00:00
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:
parent
d49db3ab29
commit
8df9e6d73d
1 changed files with 8 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue