參考sunnyxx的http://blog.sunnyxx.com/2014/10/15/behind-autorelease/
C++實現(xiàn)的一個類?AutoreleasePoolPage
@autoreleasepool{} ? ? 轉(zhuǎn)化為如下代碼
void *context = objc_autoreleasePoolPush(); ?//context 就是哨兵地址
// {}中的代碼
objc_autoreleasePoolPop(context); ?//release context之后的所有autoreleased的obj
在沒有手加Autorelease Pool的情況下迁筛,Autorelease對象是在當前的runloop迭代結束時釋放的,而它能夠釋放的原因是系統(tǒng)在每個runloop迭代中都加入了自動釋放池Push和Pop
手加Autorelease Pool的情況下片择,就是@autoreleasepool{} 右括號之后