Loading...
--- libmalloc/libmalloc-166.220.1/src/nano_malloc.c
+++ libmalloc/libmalloc-317.100.9/src/nano_malloc.c
@@ -37,7 +37,7 @@
nano_mag_index(const nanozone_t *nanozone)
{
if (os_likely(_os_cpu_number_override == -1)) {
- return (_os_cpu_number() >> hyper_shift) % nano_common_max_magazines;
+ return (_malloc_cpu_number() >> hyper_shift) % nano_common_max_magazines;
}
return (_os_cpu_number_override >> hyper_shift) % nano_common_max_magazines;
}
@@ -1523,9 +1523,9 @@
}
// TODO sanity checks
-unsigned nanozone_check_counter = 0;
-unsigned nanozone_check_start = 0;
-unsigned nanozone_check_modulo = 1;
+static unsigned nanozone_check_counter = 0;
+static unsigned nanozone_check_start = 0;
+static unsigned nanozone_check_modulo = 1;
static boolean_t
nano_check_all(nanozone_t *nanozone, const char *function)
@@ -1896,9 +1896,12 @@
mprotect(nanozone, sizeof(nanozone->basic_zone), PROT_READ); /* Prevent overwriting the function pointers in basic_zone. */
/* Nano zone does not support MALLOC_ADD_GUARD_PAGES. */
- if (debug_flags & MALLOC_ADD_GUARD_PAGES) {
- malloc_report(ASL_LEVEL_INFO, "nano zone does not support guard pages\n");
- debug_flags &= ~MALLOC_ADD_GUARD_PAGES;
+ if (debug_flags & MALLOC_ALL_GUARD_PAGE_FLAGS) {
+ if (!(debug_flags & MALLOC_GUARD_ALL)) {
+ // Don't report when MallocGuardEdges == "all".
+ malloc_report(ASL_LEVEL_INFO, "nano zone does not support guard pages\n");
+ }
+ debug_flags &= ~MALLOC_ALL_GUARD_PAGE_FLAGS;
}
/* set up the remainder of the nanozone structure */