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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;

use crate::*;

extern "C" {
    pub fn NSDefaultMallocZone() -> NonNull<NSZone>;
}

extern "C" {
    pub fn NSCreateZone(
        start_size: NSUInteger,
        granularity: NSUInteger,
        can_free: Bool,
    ) -> NonNull<NSZone>;
}

extern "C" {
    pub fn NSRecycleZone(zone: NonNull<NSZone>);
}

extern "C" {
    #[cfg(feature = "NSString")]
    pub fn NSSetZoneName(zone: *mut NSZone, name: &NSString);
}

extern "C" {
    #[cfg(feature = "NSString")]
    pub fn NSZoneName(zone: *mut NSZone) -> NonNull<NSString>;
}

extern "C" {
    pub fn NSZoneFromPointer(ptr: NonNull<c_void>) -> *mut NSZone;
}

extern "C" {
    pub fn NSZoneMalloc(zone: *mut NSZone, size: NSUInteger) -> NonNull<c_void>;
}

extern "C" {
    pub fn NSZoneCalloc(
        zone: *mut NSZone,
        num_elems: NSUInteger,
        byte_size: NSUInteger,
    ) -> NonNull<c_void>;
}

extern "C" {
    pub fn NSZoneRealloc(zone: *mut NSZone, ptr: *mut c_void, size: NSUInteger) -> NonNull<c_void>;
}

extern "C" {
    pub fn NSZoneFree(zone: *mut NSZone, ptr: NonNull<c_void>);
}

pub const NSScannedOption: NSUInteger = 1 << 0;
pub const NSCollectorDisabledOption: NSUInteger = 1 << 1;

extern "C" {
    pub fn NSAllocateCollectable(size: NSUInteger, options: NSUInteger) -> NonNull<c_void>;
}

extern "C" {
    pub fn NSReallocateCollectable(
        ptr: *mut c_void,
        size: NSUInteger,
        options: NSUInteger,
    ) -> NonNull<c_void>;
}

extern "C" {
    pub fn NSPageSize() -> NSUInteger;
}

extern "C" {
    pub fn NSLogPageSize() -> NSUInteger;
}

extern "C" {
    pub fn NSRoundUpToMultipleOfPageSize(bytes: NSUInteger) -> NSUInteger;
}

extern "C" {
    pub fn NSRoundDownToMultipleOfPageSize(bytes: NSUInteger) -> NSUInteger;
}

extern "C" {
    pub fn NSAllocateMemoryPages(bytes: NSUInteger) -> NonNull<c_void>;
}

extern "C" {
    pub fn NSDeallocateMemoryPages(ptr: NonNull<c_void>, bytes: NSUInteger);
}

extern "C" {
    pub fn NSCopyMemoryPages(source: NonNull<c_void>, dest: NonNull<c_void>, bytes: NSUInteger);
}

extern "C" {
    #[deprecated = "Use NSProcessInfo instead"]
    pub fn NSRealMemoryAvailable() -> NSUInteger;
}