NSAutoReleasePool
来源:互联网 发布:开票软件主程序打不开 编辑:程序博客网 时间:2024/05/21 14:46
一般来说在应用的main thread中, 已经存在了一个autorelease pool. 有两种情况需要开发者自己新建autorelease pool:
- 在main thread中, 在某个方法中出现大量的autoreleased objects, 为了避免memory footprint的增大, 可以手动创建一些autorelease pool用来drain objects.
- 创建新的thread, 并在其中访问了Cocoa, 需要在访问的前创建autorelease pool, 访问结束后drain.
最后一点, 在每个thread中都会维持一个stack, 其中放置着所有在这个thread中创建但未销毁的pool, 每当一个新的pool创建后, 它就位于stack的最顶端, 相应autoreleased object就会放入其中. 当pool drain的时候, 它就会从stack的顶端移除, 并且release掉其包含的objects.
- NSAutoreleasepool
- NSAutoreleasePool
- NSAutoReleasePool
- NSAutoReleasePool
- NSAutoreleasePool
- NSAutoreleasePool
- NSAutoReleasePool
- NSAutoreleasePool
- NSAutoreleasePool是什么?
- NSAutoreleasePool 随笔
- NSAutoReleasePool 用法
- 转载NSAutoReleasePool
- NSAutoreleasePool错误
- IOS NSAutoreleasePool
- 危险的NSAutoreleasePool
- Objective-C 之NSAutoreleasePool
- NSAutoreleasePool自动释放池
- 关于NSAutoReleasePool的理解
- Android 监听应用卸载
- python 打印表单格式
- 通过宏判断VS编译版本以及系统平台
- 在JAVA中设置属性提示/方法补充的方法
- c++ 使用中的一些注意点
- NSAutoReleasePool
- 三个月的开发总结
- 二叉树的存储结构和实现
- 阻塞与非阻塞I/O
- 15.C++ 作用域限定运算符
- libsvm基本使用指南
- 第三章第一题
- SQL 临时表的应用
- 如何申请微信公众平台帐号