|
|
|
|
|
by vlovich123
1171 days ago
|
|
Correct. But it’ll do it within functions in the same module. > but it's deterministic after compilation time so I wouldn't call it a runtime optimization. What do you mean? My understanding is that autoreleasepool is 100% at runtime. The compiler is not involved afaik except to know to register autorelease with the currently installed pool. |
|
The compiler emits calls that always put something in the autorelease pool or always don't; there's no smart decisions at runtime that skips it or make the ordering of releases nondeterministic. A garbage collector runs whenever it feels like and so the ordering of finalizations changes.