Loading...
--- libmalloc/libmalloc-283.40.1/src/nano_malloc.c
+++ libmalloc/libmalloc-317.140.5/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;
 }
@@ -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 */