Search code examples
iosgarbage-collectionboehm-gc

Private API call not allowed in iOS (function "exc_server")


My iOS app (using the Boehm garbage collector) was rejected in the AppStore because of one private API function call. Here the offending function in file os_dep.c:

/* These are not defined in any header, although they are documented */
extern boolean_t
exc_server(mach_msg_header_t *, mach_msg_header_t *);

Here the link to the file: os_dep.c on github

I tried to comment out both the function definition and call, and the app seems running fine, but that's a really bad hack.

My question: is this function call critical? Is it really needed in iOS?


Solution

  • The function is only needed in the incremental GC mode which is enabled by GC_enable_incremental() call. I suspect you don't call it, so exc_server() and friends aren't called in the app.

    Instead of commenting out exc_server(), I'd recommend you to pass "-D GC_DISABLE_INCREMENTAL" which removes the incremental mode support from the collector binary.