Skip to content

Commit c2ac394

Browse files
authored
Merge pull request swiftlang#2632 from 3405691582/Prefix_UnifyMallocDefaultZone
[CF] One malloc_default_zone macro for non-macOS.
2 parents a7edcbd + d252f3e commit c2ac394

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

CoreFoundation/Base.subproj/CoreFoundation_Prefix.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,8 @@ CF_INLINE uint64_t mach_absolute_time() {
219219
return (uint64_t)ts.tv_nsec + (uint64_t)ts.tv_sec * 1000000000UL;
220220
#endif
221221
}
222+
223+
#define malloc_default_zone() (void *)0
222224
#endif // TARGET_OS_LINUX || TARGET_OS_BSD || TARGET_OS_WIN32
223225

224226
#if TARGET_OS_LINUX || TARGET_OS_WIN32 || defined(__OpenBSD__)
@@ -268,9 +270,6 @@ typedef unsigned long fd_mask;
268270
CF_INLINE size_t malloc_size(void *memblock) {
269271
return malloc_usable_size(memblock);
270272
}
271-
272-
#define malloc_default_zone() (void *)0
273-
274273
#endif
275274

276275
#if TARGET_OS_BSD
@@ -324,7 +323,6 @@ CF_EXPORT int _NS_access(const char *name, int amode);
324323

325324
#define __PRETTY_FUNCTION__ __FUNCTION__
326325

327-
#define malloc_default_zone() (void *)0
328326
#define malloc_zone_from_ptr(a) (void *)0
329327
#define malloc_zone_malloc(zone,size) malloc(size)
330328
#define malloc_zone_memalign(zone,align,size) malloc(size)

0 commit comments

Comments
 (0)