[swift-dev] No return functions and program exit

Joe Groff jgroff at apple.com
Mon Feb 6 13:25:04 CST 2017


> On Feb 6, 2017, at 11:22 AM, Michael Gottesman <mgottesman at apple.com> wrote:
> 
> Here is my suggestion:
> 
> 1. We assume by default the leaking case.
> 2. We change noreturn functions from C to maybe have a special semantic tag on them that says that cleanups should occur before them (i.e. UIApplicationMain).

I feel that "clean up before" is the safer ground case, and if we do any work to whitelist a group, it should be for the common "leakable" noreturns, like exit/_exit/abort/fatalError. That way, we momentarily burn some pointless cycles in the case we get it "wrong" rather than permanently leak memory.

-Joe


More information about the swift-dev mailing list