Skip to content

CoreFoundation iOS xcode16.0 b5

Rolf Bjarne Kvinge edited this page Aug 26, 2024 · 3 revisions

#CoreFoundation.framework https://github.com/xamarin/xamarin-macios/pull/21116

diff -ruN /Applications/Xcode_16.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h /Applications/Xcode_16.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h
--- /Applications/Xcode_16.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h	2024-07-17 00:02:39
+++ /Applications/Xcode_16.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h	2024-07-26 23:20:22
@@ -85,6 +85,23 @@
   #endif
 #endif
 
+// from <malloc/malloc.h>
+typedef unsigned long long CFAllocatorTypeID;
+
+#if TARGET_OS_MAC && (defined(CF_BUILDING_CF) || defined(NSBUILDINGFOUNDATION))
+    #if defined(__has_feature) && __has_feature(typed_memory_operations)
+        #if __has_builtin(__is_target_os) && (__is_target_os(ios) || __is_target_os(driverkit) || __is_target_os(macos) || (__has_builtin(__is_target_environment) && (__is_target_environment(exclavekit) || __is_target_environment(exclavecore))))
+            #define _CF_TYPED_ALLOC(override, type_param_pos) __attribute__((typed_memory_operation(override, type_param_pos)))
+            #define CF_HAS_TYPED_ALLOCATOR 1
+        #endif
+    #endif /* defined(__has_feature) && __has_feature(typed_memory_operations) */
+#endif /* TARGET_OS_MAC && (defined(CF_BUILDING_CF) || defined(NSBUILDINGFOUNDATION)) */
+
+#if !defined(_CF_TYPED_ALLOC)
+#define _CF_TYPED_ALLOC(override, type_param_pos)
+#define CF_HAS_TYPED_ALLOCATOR 0
+#endif
+
 #if !defined(__MACTYPES__)
 #if !defined(_OS_OSTYPES_H)
 
@@ -648,11 +665,30 @@
 CF_EXPORT
 CFAllocatorRef CFAllocatorCreate(CFAllocatorRef allocator, CFAllocatorContext *context);
 
+/* Typed allocator interfaces
+
+   These interfaces are provided to either serve as rewrite targets for the
+   compiler, or to be invoked internally to Foundation/CoreFoundation to
+   manually interfact with the typed allocator.
+*/
+
 CF_EXPORT
-void *CFAllocatorAllocate(CFAllocatorRef allocator, CFIndex size, CFOptionFlags hint);
+void *CFAllocatorAllocateTyped(CFAllocatorRef allocator, CFIndex size, CFAllocatorTypeID descriptor, CFOptionFlags hint) API_AVAILABLE(macos(15.0), ios(18.0), watchos(11.0), tvos(18.0), visionos(2.0));
 
 CF_EXPORT
-void *CFAllocatorReallocate(CFAllocatorRef allocator, void *ptr, CFIndex newsize, CFOptionFlags hint);
+void *CFAllocatorReallocateTyped(CFAllocatorRef allocator, void *ptr, CFIndex newsize, CFAllocatorTypeID descriptor, CFOptionFlags hint) API_AVAILABLE(macos(15.0), ios(18.0), watchos(11.0), tvos(18.0), visionos(2.0));
+
+CF_EXPORT
+void *CFAllocatorAllocateBytes(CFAllocatorRef allocator, CFIndex size, CFOptionFlags hint) API_AVAILABLE(macos(15.0), ios(18.0), watchos(11.0), tvos(18.0), visionos(2.0));
+
+CF_EXPORT
+void *CFAllocatorReallocateBytes(CFAllocatorRef allocator, void *ptr, CFIndex newsize, CFOptionFlags hint) API_AVAILABLE(macos(15.0), ios(18.0), watchos(11.0), tvos(18.0), visionos(2.0));
+
+CF_EXPORT
+void *CFAllocatorAllocate(CFAllocatorRef allocator, CFIndex size, CFOptionFlags hint) _CF_TYPED_ALLOC(CFAllocatorAllocateTyped, 2);
+
+CF_EXPORT
+void *CFAllocatorReallocate(CFAllocatorRef allocator, void *ptr, CFIndex newsize, CFOptionFlags hint) _CF_TYPED_ALLOC(CFAllocatorReallocateTyped, 3);
 
 CF_EXPORT
 void CFAllocatorDeallocate(CFAllocatorRef allocator, void *ptr);
Clone this wiki locally