Skip to content

Commit d252f3e

Browse files
committed
[CF] One malloc_default_zone macro for non-macOS.
malloc_default_zone is unavailable outside of macOS so requires redefining in Prefix. We have a definition for Linux and Windows, but this is also required for BSD, so move this to the common Linux, BSD, and Windows block.
1 parent a5aa8a0 commit d252f3e

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

Diff for: CoreFoundation/Base.subproj/CoreFoundation_Prefix.h

+2-4
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)