1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
use c_void;
/// Calls a function in the context of a new autorelease pool, like
/// `@autoreleasepool`.
///
/// See [documentation](https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/MemoryMgmt/Articles/mmAutoreleasePools.html).
///
/// # Panic Handling
///
/// If a panic occurs within the function, the autorelease pool is drained as
/// the stack unwinds.
///
/// This is implemented with [`Drop`].
// For macOS 10.6 and lower, Clang emits `[[NSAutoreleasePool alloc] init]` and
// `-[NSAutoreleasePool drain]`. However, 10.7 is the minimum supported version
// for Rust.
extern "C"
;