The Objective-C runtime supports autorelease pools via a language
specific ABI supplement, akin to the “Itanium” generic ABI for C++.
https://clang.llvm.org/docs/AutomaticReferenceCounting.html#runtime-support
These interfaces are used by NSAutoreleasePool internally, as well as
inserted by the compiler when using the @autoreleasepool syntax in
Objective-C code.
We have our own wrapper, QMacAutoReleasePool, which allows us to
set up pools in C++ code as well. We now use these lower level
interfaces in the implementation, instead of NSAutoreleasePool,
as this reduces overhead due to not needing to allocate and destroy
a NSAutoreleasePool.
This also opens up the possibility of using Automatic Reference Counting
(ARC) in Qt down the road, as explicit NSAutoreleasePool usage is forbidden
in that mode (while @autoreleasepool is not, and uses the runtime ABI
internally as before).
Change-Id: I06fdb4a24ae4972820f866e0a129a1b355bc8a6b
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>