File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -43,15 +43,15 @@ $ clang -rewrite-objc main.m
43
43
44
44
> 这里删除了 ` main ` 函数中其他无用的代码。
45
45
46
- 在这个文件中,有一个非常奇怪的 ` __AtAutoreleasePool ` 的结构体,前面的注释写到 ` /* @autoreleasepopl */ ` 。也就是说 ` @autoreleasepool {} ` 被转换为 :
46
+ 在这个文件中,有一个非常奇怪的 ` __AtAutoreleasePool ` 的结构体,前面的注释写到 ` /* @autoreleasepool */ ` 。也就是说 ` @autoreleasepool {} ` 被转换为一个 ` __AtAutoreleasePool ` 结构体 :
47
47
48
48
``` objectivec
49
49
{
50
50
__AtAutoreleasePool __autoreleasepool;
51
51
}
52
52
```
53
53
54
- 在 ` main.cpp ` 中查找名为 ` __AtAutoreleasePool ` 的结构体:
54
+ 想要弄清楚这行代码的意义,我们要在 ` main.cpp ` 中查找名为 ` __AtAutoreleasePool ` 的结构体:
55
55
56
56
![ objc-autorelease-main-cpp-struct] ( ../images/objc-autorelease-main-cpp-struct.png )
57
57
@@ -65,7 +65,7 @@ struct __AtAutoreleasePool {
65
65
66
66
这个结构体会在初始化时调用 ` objc_autoreleasePoolPush() ` 方法,会在析构时调用 ` objc_autoreleasePoolPop ` 方法。
67
67
68
- 这表明,我们的 ` main ` 函数其实是这样的 :
68
+ 这表明,我们的 ` main ` 函数在实际工作时其实是这样的 :
69
69
70
70
``` objectivec
71
71
int main (int argc, const char * argv[ ] ) {
You can’t perform that action at this time.
0 commit comments