docs: 年度总结

This commit is contained in:
binpeng.liu
2022-12-31 22:57:16 +08:00
parent 9b9641c03b
commit af6ee1186c
6 changed files with 59 additions and 4 deletions

View File

@@ -1961,9 +1961,9 @@ static inline id *autoreleaseFast(id obj) {
### autorelease 对象什么时候调用 release 方法
每当进行一次`objc_autoreleasePoolPush`调用时runtime向当前的AutoreleasePoolPageadd进一个`哨兵对象`值为0也就是个nil那么这一个page就变成了下面的样子
每当进行一次`objc_autoreleasePoolPush`调用时runtime 向当前的 AutoreleasePoolPageadd 进一个`哨兵对象`值为0也就是个nil那么这一个page就变成了下面的样子
![](http://ww2.sinaimg.cn/large/51530583gw1elj5z7hawej20ji0dewff.jpg)
![](https://github.com/FantasticLBP/knowledge-kit/raw/master/assets/autoreleasepool-push.png)
`objc_autoreleasePoolPush`的返回值正是这个哨兵对象的地址,被`objc_autoreleasePoolPop(哨兵对象)`作为入参,于是: