Lack of autorelease optimization under ARC compiler

前端 未结 3 1163
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-25 08:00

I was just wondering, why is there no autorelease pool optimization under the ARC compiler, where it would retain an object in the innermost scope, remove it from the autoreleas

3条回答
  •  迷失自我
    2021-01-25 08:03

    Why do you believe that ARC doesn't optimize the above code? Try it in Release mode under Instruments. The heap doesn't grow. If you're testing under Debug, then the problem is that you're not engaging the optimizer.

提交回复
热议问题