Loading...
src/purgeable_malloc.c libmalloc-283.60.1 libmalloc-283.100.6
--- libmalloc/libmalloc-283.60.1/src/purgeable_malloc.c
+++ libmalloc/libmalloc-283.100.6/src/purgeable_malloc.c
@@ -354,7 +354,7 @@
 	uint64_t hw_memsize = 0;
 
 	/* get memory for the zone. */
-	szone = mvm_allocate_pages(SZONE_PAGED_SIZE, 0, 0, VM_MEMORY_MALLOC);
+	szone = mvm_allocate_pages(SZONE_PAGED_SIZE, 0, DISABLE_ASLR, VM_MEMORY_MALLOC);
 	if (!szone) {
 		return NULL;
 	}
@@ -412,11 +412,13 @@
 	szone->debug_flags = debug_flags | MALLOC_PURGEABLE;
 
 	/* Purgeable zone does not support MALLOC_ADD_GUARD_PAGES. */
-	if (szone->debug_flags & MALLOC_ADD_GUARD_PAGES) {
-		malloc_report(ASL_LEVEL_INFO, "purgeable zone does not support guard pages\n");
-		szone->debug_flags &= ~MALLOC_ADD_GUARD_PAGES;
-	}
-
+	if (szone->debug_flags & MALLOC_ALL_GUARD_PAGE_FLAGS) {
+		if (!(szone->debug_flags & MALLOC_GUARD_ALL)) {
+			// Don't report when MallocGuardEdges == "all".
+			malloc_report(ASL_LEVEL_INFO, "purgeable zone does not support guard pages\n");
+		}
+		szone->debug_flags &= ~MALLOC_ALL_GUARD_PAGE_FLAGS;
+	}
 	_malloc_lock_init(&szone->large_szone_lock);
 
 	szone->helper_zone = (struct szone_s *)malloc_default_zone;