Skip to content

Commit b1b4603

Browse files
authored
Move __CFAllocatorRespectsHintZeroWhenAllocating to a CF-internal header to avoid confusion over its linkage. Resolves swiftlang#5125 (swiftlang#5126)
1 parent af2bcc5 commit b1b4603

File tree

4 files changed

+3
-5
lines changed

4 files changed

+3
-5
lines changed

Sources/CoreFoundation/CFBase.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,7 @@ void *__CFSafelyReallocateWithAllocator(CFAllocatorRef allocator, void *destinat
790790
return _CLANG_ANALYZER_IGNORE_NONNULL(reallocated);;
791791
}
792792

793-
Boolean __CFAllocatorRespectsHintZeroWhenAllocating(CFAllocatorRef allocator) {
793+
CF_PRIVATE Boolean __CFAllocatorRespectsHintZeroWhenAllocating(CFAllocatorRef allocator) {
794794
return allocator == kCFAllocatorSystemDefault || allocator == kCFAllocatorMallocZone;
795795
}
796796

Sources/CoreFoundation/include/ForFoundationOnly.h

-2
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,6 @@ CF_EXPORT void *_Nonnull __CFSafelyReallocate(void * _Nullable destination, size
7070
CF_EXPORT void *_Nonnull __CFSafelyReallocateWithAllocator(CFAllocatorRef _Nullable, void * _Nullable destination, size_t newCapacity, CFOptionFlags options, void (^_Nullable reallocationFailureHandler)(void *_Nonnull original, bool *_Nonnull outRecovered));
7171
#endif
7272

73-
Boolean __CFAllocatorRespectsHintZeroWhenAllocating(CFAllocatorRef _Nullable allocator);
74-
7573
typedef CF_ENUM(CFOptionFlags, _CFAllocatorHint) {
7674
_CFAllocatorHintZeroWhenAllocating = 1
7775
};

Sources/CoreFoundation/include/ForSwiftFoundationOnly.h

-2
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,6 @@
105105

106106
_CF_EXPORT_SCOPE_BEGIN
107107

108-
CF_PRIVATE Boolean __CFAllocatorRespectsHintZeroWhenAllocating(CFAllocatorRef _Nullable allocator);
109-
110108
struct __CFSwiftObject {
111109
uintptr_t isa;
112110
};

Sources/CoreFoundation/internalInclude/CFInternal.h

+2
Original file line numberDiff line numberDiff line change
@@ -1057,6 +1057,8 @@ CF_INLINE CFAllocatorRef __CFGetAllocator(CFTypeRef cf) { // !!! Use with CF typ
10571057
return *(CFAllocatorRef *)((char *)cf - 16);
10581058
}
10591059

1060+
CF_PRIVATE Boolean __CFAllocatorRespectsHintZeroWhenAllocating(CFAllocatorRef allocator);
1061+
10601062
/* !!! Avoid #importing objc.h; e.g. converting this to a .m file */
10611063
struct __objcFastEnumerationStateEquivalent {
10621064
unsigned long state;

0 commit comments

Comments
 (0)