//! This file has been automatically generated by `objc2`'s `header-translator`. //! DO NOT EDIT use core::ffi::*; use core::ptr::NonNull; use objc2::__framework_prelude::*; use crate::*; #[inline] pub extern "C-unwind" fn NSDefaultMallocZone() -> NonNull { extern "C-unwind" { fn NSDefaultMallocZone() -> Option>; } let ret = unsafe { NSDefaultMallocZone() }; ret.expect("function was marked as returning non-null, but actually returned NULL") } #[inline] pub extern "C-unwind" fn NSCreateZone( start_size: NSUInteger, granularity: NSUInteger, can_free: bool, ) -> NonNull { extern "C-unwind" { fn NSCreateZone( start_size: NSUInteger, granularity: NSUInteger, can_free: Bool, ) -> Option>; } let ret = unsafe { NSCreateZone(start_size, granularity, Bool::new(can_free)) }; ret.expect("function was marked as returning non-null, but actually returned NULL") } extern "C-unwind" { /// # Safety /// /// `zone` must be a valid pointer. pub fn NSRecycleZone(zone: NonNull); } extern "C-unwind" { /// # Safety /// /// `zone` must be a valid pointer or null. #[cfg(feature = "NSString")] pub fn NSSetZoneName(zone: *mut NSZone, name: &NSString); } /// # Safety /// /// `zone` must be a valid pointer or null. #[cfg(feature = "NSString")] #[inline] pub unsafe extern "C-unwind" fn NSZoneName(zone: *mut NSZone) -> Retained { extern "C-unwind" { fn NSZoneName(zone: *mut NSZone) -> *mut NSString; } let ret = unsafe { NSZoneName(zone) }; unsafe { Retained::retain_autoreleased(ret) } .expect("function was marked as returning non-null, but actually returned NULL") } extern "C-unwind" { /// # Safety /// /// `ptr` must be a valid pointer. pub fn NSZoneFromPointer(ptr: NonNull) -> *mut NSZone; } /// # Safety /// /// `zone` must be a valid pointer or null. #[inline] pub unsafe extern "C-unwind" fn NSZoneMalloc( zone: *mut NSZone, size: NSUInteger, ) -> NonNull { extern "C-unwind" { fn NSZoneMalloc(zone: *mut NSZone, size: NSUInteger) -> Option>; } let ret = unsafe { NSZoneMalloc(zone, size) }; ret.expect("function was marked as returning non-null, but actually returned NULL") } /// # Safety /// /// `zone` must be a valid pointer or null. #[inline] pub unsafe extern "C-unwind" fn NSZoneCalloc( zone: *mut NSZone, num_elems: NSUInteger, byte_size: NSUInteger, ) -> NonNull { extern "C-unwind" { fn NSZoneCalloc( zone: *mut NSZone, num_elems: NSUInteger, byte_size: NSUInteger, ) -> Option>; } let ret = unsafe { NSZoneCalloc(zone, num_elems, byte_size) }; ret.expect("function was marked as returning non-null, but actually returned NULL") } /// # Safety /// /// - `zone` must be a valid pointer or null. /// - `ptr` must be a valid pointer or null. #[inline] pub unsafe extern "C-unwind" fn NSZoneRealloc( zone: *mut NSZone, ptr: *mut c_void, size: NSUInteger, ) -> NonNull { extern "C-unwind" { fn NSZoneRealloc( zone: *mut NSZone, ptr: *mut c_void, size: NSUInteger, ) -> Option>; } let ret = unsafe { NSZoneRealloc(zone, ptr, size) }; ret.expect("function was marked as returning non-null, but actually returned NULL") } extern "C-unwind" { /// # Safety /// /// - `zone` must be a valid pointer or null. /// - `ptr` must be a valid pointer. pub fn NSZoneFree(zone: *mut NSZone, ptr: NonNull); } /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsscannedoption?language=objc) pub const NSScannedOption: NSUInteger = 1 << 0; /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nscollectordisabledoption?language=objc) pub const NSCollectorDisabledOption: NSUInteger = 1 << 1; #[inline] pub extern "C-unwind" fn NSAllocateCollectable( size: NSUInteger, options: NSUInteger, ) -> NonNull { extern "C-unwind" { fn NSAllocateCollectable(size: NSUInteger, options: NSUInteger) -> Option>; } let ret = unsafe { NSAllocateCollectable(size, options) }; ret.expect("function was marked as returning non-null, but actually returned NULL") } /// # Safety /// /// `ptr` must be a valid pointer or null. #[inline] pub unsafe extern "C-unwind" fn NSReallocateCollectable( ptr: *mut c_void, size: NSUInteger, options: NSUInteger, ) -> NonNull { extern "C-unwind" { fn NSReallocateCollectable( ptr: *mut c_void, size: NSUInteger, options: NSUInteger, ) -> Option>; } let ret = unsafe { NSReallocateCollectable(ptr, size, options) }; ret.expect("function was marked as returning non-null, but actually returned NULL") } #[inline] pub extern "C-unwind" fn NSPageSize() -> NSUInteger { extern "C-unwind" { fn NSPageSize() -> NSUInteger; } unsafe { NSPageSize() } } #[inline] pub extern "C-unwind" fn NSLogPageSize() -> NSUInteger { extern "C-unwind" { fn NSLogPageSize() -> NSUInteger; } unsafe { NSLogPageSize() } } #[inline] pub extern "C-unwind" fn NSRoundUpToMultipleOfPageSize(bytes: NSUInteger) -> NSUInteger { extern "C-unwind" { fn NSRoundUpToMultipleOfPageSize(bytes: NSUInteger) -> NSUInteger; } unsafe { NSRoundUpToMultipleOfPageSize(bytes) } } #[inline] pub extern "C-unwind" fn NSRoundDownToMultipleOfPageSize(bytes: NSUInteger) -> NSUInteger { extern "C-unwind" { fn NSRoundDownToMultipleOfPageSize(bytes: NSUInteger) -> NSUInteger; } unsafe { NSRoundDownToMultipleOfPageSize(bytes) } } #[inline] pub extern "C-unwind" fn NSAllocateMemoryPages(bytes: NSUInteger) -> NonNull { extern "C-unwind" { fn NSAllocateMemoryPages(bytes: NSUInteger) -> Option>; } let ret = unsafe { NSAllocateMemoryPages(bytes) }; ret.expect("function was marked as returning non-null, but actually returned NULL") } extern "C-unwind" { /// # Safety /// /// `ptr` must be a valid pointer. pub fn NSDeallocateMemoryPages(ptr: NonNull, bytes: NSUInteger); } extern "C-unwind" { /// # Safety /// /// - `source` must be a valid pointer. /// - `dest` must be a valid pointer. pub fn NSCopyMemoryPages(source: NonNull, dest: NonNull, bytes: NSUInteger); } #[deprecated = "Use NSProcessInfo instead"] #[inline] pub extern "C-unwind" fn NSRealMemoryAvailable() -> NSUInteger { extern "C-unwind" { fn NSRealMemoryAvailable() -> NSUInteger; } unsafe { NSRealMemoryAvailable() } }