且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

iOS 自动释放池 main 和 ARC 分配,释放

更新时间:2023-02-17 13:47:32

目前,使用 LLVM 编译器,每个线程默认都有一个自动释放池,这不是必需的.如果你使用不同的编译器和不同的自动释放池实现(它们现在是一个语言特性),你需要为每个线程设置一个自动释放池.调用永远不会返回无关紧要,必须设置池(并且可以通过它排空).

Currently, with LLVM compiler every thread has an autorelease pool by default and this is not needed. If you use a different compiler with a different implementation for autorelease pools (they are now a language feature), you are required to set up an autorelease pool for every thread. It doesn't matter that the call never returns, the pool has to be set up (and it can be drained thanks to it).

我找不到重复的问题,但我确定它在那里.

I can't find the duplicate question but I am sure it's there.