Loading...
--- libmalloc/libmalloc-474.0.13/src/base.h
+++ libmalloc/libmalloc-374.40.6/src/base.h
@@ -71,7 +71,14 @@
# define MALLOC_CACHE_LINE 128
# define MALLOC_NANO_CACHE_LINE 64
#elif defined(__arm__) || defined(__arm64__)
-# define MALLOC_CACHE_LINE 128
+# if TARGET_OS_OSX || TARGET_OS_DRIVERKIT || TARGET_OS_SIMULATOR
+// To make zone structure layout match to support introspecting a Rosetta process
+// from a native process or vice versa on macOS. See comment in
+// quarantine_diagnose_fault_from_crash_reporter.
+# define MALLOC_CACHE_LINE 128
+# else
+# define MALLOC_CACHE_LINE 64
+# endif
# define MALLOC_NANO_CACHE_LINE 64
#else
# define MALLOC_CACHE_LINE 32
@@ -88,23 +95,11 @@
#define MALLOC_PACKED __attribute__((packed))
#define MALLOC_USED __attribute__((used))
#define MALLOC_UNUSED __attribute__((unused))
-#define MALLOC_NORETURN __attribute__((noreturn))
-#define MALLOC_COLD __attribute__((cold))
-#define MALLOC_NOESCAPE __attribute__((noescape))
#define CHECK_MAGAZINE_PTR_LOCKED(szone, mag_ptr, fun) {}
#define SCRIBBLE_BYTE 0xaa /* allocated scribble */
#define SCRABBLE_BYTE 0x55 /* free()'d scribble */
#define SCRUBBLE_BYTE 0xdd /* madvise(..., MADV_FREE) scriblle */
-
-#undef KiB
-#undef MiB
-#undef GiB
-#undef TiB
-#define KiB(x) ((uint64_t)(x) << 10)
-#define MiB(x) ((uint64_t)(x) << 20)
-#define GiB(x) ((uint64_t)(x) << 30)
-#define TiB(x) ((uint64_t)(x) << 40)
#define NDEBUG 1
#define trunc_page_quanta(x) trunc_page((x))