Loading...
--- libmalloc/libmalloc-374.40.6/src/base.h
+++ libmalloc/libmalloc-116/src/base.h
@@ -47,19 +47,15 @@
 		__builtin_trap(); \
 })
 
-#define MALLOC_REPORT_FATAL_ERROR(cause, message) ({ \
-		malloc_report(ASL_LEVEL_ERR, "*** FATAL ERROR - " message ".\n"); \
+#define MALLOC_PRINTF_FATAL_ERROR(cause, message) ({ \
+		malloc_printf("*** FATAL ERROR - " message ".\n"); \
 		MALLOC_FATAL_ERROR((cause), message); \
 })
 
 #if defined(__i386__) || defined(__x86_64__) || defined(__arm__) || defined(__arm64__)
 #   define __APPLE_API_PRIVATE
 #   include <machine/cpu_capabilities.h>
-#   if defined(__i386__) || defined(__x86_64__)
-#      define _COMM_PAGE_VERSION_REQD 9
-#   else
-#      define _COMM_PAGE_VERSION_REQD 3
-#   endif
+#   define _COMM_PAGE_VERSION_REQD 9
 #   undef __APPLE_API_PRIVATE
 #else
 #   include <sys/sysctl.h>
@@ -71,14 +67,7 @@
 #   define MALLOC_CACHE_LINE 128
 #   define MALLOC_NANO_CACHE_LINE 64
 #elif defined(__arm__) || defined(__arm64__)
-#	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_CACHE_LINE 64
 #   define MALLOC_NANO_CACHE_LINE 64
 #else
 #   define MALLOC_CACHE_LINE 32
@@ -107,43 +96,20 @@
 #define vm_page_quanta_size (vm_page_size)
 #define vm_page_quanta_shift (vm_page_shift)
 
-/*
- * Large rounds allocation sizes up to MAX(vm_kernel_page_size, page_size).
- * This provides better death row caching performance when vm_kernel_page_size > page_size.
- * The kernel allocates pages of vm_kernel_page_size to back our allocations,
- * so there is no additional physical page cost to doing this.
- * Guard pages are the same size to ensure the full vm allocation size is a multiple of MAX(vm_kernel_page_size, page_size).
- */
-#define large_vm_page_quanta_size (vm_kernel_page_size > vm_page_size ? vm_kernel_page_size : vm_page_size)
-#define large_vm_page_quanta_mask (vm_kernel_page_mask > vm_page_mask ? vm_kernel_page_mask : vm_page_mask)
-#define large_vm_page_quanta_shift (vm_kernel_page_shift > vm_page_shift ? vm_kernel_page_shift : vm_page_shift)
-
-#define trunc_large_page_quanta(x) ((x) & (~large_vm_page_quanta_mask))
-#define round_large_page_quanta(x) (trunc_large_page_quanta((x) + large_vm_page_quanta_mask))
-
-
-// add a guard page before each VM region to help debug
-#define MALLOC_ADD_PRELUDE_GUARD_PAGE (1 << 0)
-// add a guard page after each VM region to help debug
-#define MALLOC_ADD_POSTLUDE_GUARD_PAGE (1 << 1)
-// Mask both guard page flags
-#define MALLOC_ADD_GUARD_PAGE_FLAGS (MALLOC_ADD_PRELUDE_GUARD_PAGE|MALLOC_ADD_POSTLUDE_GUARD_PAGE)
-// apply guard pages to all regions
-#define MALLOC_GUARD_ALL (1 << 2)
-// Mask for guard page request flags
-#define MALLOC_ALL_GUARD_PAGE_FLAGS (MALLOC_ADD_GUARD_PAGE_FLAGS|MALLOC_GUARD_ALL)
+// add a guard page before and after each VM region to help debug
+#define MALLOC_ADD_GUARD_PAGES (1 << 0)
 // do not protect prelude page
-#define MALLOC_DONT_PROTECT_PRELUDE (1 << 3)
+#define MALLOC_DONT_PROTECT_PRELUDE (1 << 1)
 // do not protect postlude page
-#define MALLOC_DONT_PROTECT_POSTLUDE (1 << 4)
+#define MALLOC_DONT_PROTECT_POSTLUDE (1 << 2)
 // write 0x55 onto free blocks
-#define MALLOC_DO_SCRIBBLE (1 << 5)
+#define MALLOC_DO_SCRIBBLE (1 << 3)
 // call abort() on any malloc error, such as double free or out of memory.
-#define MALLOC_ABORT_ON_ERROR (1 << 6)
+#define MALLOC_ABORT_ON_ERROR (1 << 4)
 // allocate objects such that they may be used with VM purgability APIs
-#define MALLOC_PURGEABLE (1 << 7)
+#define MALLOC_PURGEABLE (1 << 5)
 // call abort() on malloc errors, but not on out of memory.
-#define MALLOC_ABORT_ON_CORRUPTION (1 << 8)
+#define MALLOC_ABORT_ON_CORRUPTION (1 << 6)
 
 /*
  * msize - a type to refer to the number of quanta of a tiny or small
@@ -155,7 +121,6 @@
 typedef unsigned int grain_t; // N.B. wide enough to index all free slots
 typedef struct large_entry_s large_entry_t;
 typedef struct szone_s szone_t;
-typedef struct rack_s rack_t;
 typedef struct magazine_s magazine_t;
 typedef int mag_index_t;
 typedef void *region_t;