There is an undocumented function in the runtime API that appears (based on several toy programs) to do what its name suggests:
OBJC_EXPORT void objc_disposeClassPair(Class cls) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
However, the detailed information is pretty thin on the ground. Thus, it is more a cluster of related issues than one:
- Are there any good blog articles / blog posts around this, or does anyone have experience using it (quick Google suggests that PyObjC developers at least studied its use at some point)?
- Classes fully freed are allocated (will there be a memory leak if the application that often created and deleted classes?)
- Are there any considerations worth considering besides the usual ones about undocumented APIs?
- Where is this (maybe) used by Apple? Upload NSBundle? Quo?
source share