Module Name:    src
Committed By:   christos
Date:           Thu Sep 26 00:04:27 UTC 2024

Modified Files:
        src/external/bsd/jemalloc/dist/src: pages.c

Log Message:
bring back fix that was lost in the merge: use a local variable to modify
the allocation alignment instead of modifying globally. Fixes overallocation.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/jemalloc/dist/src/pages.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/jemalloc/dist/src/pages.c
diff -u src/external/bsd/jemalloc/dist/src/pages.c:1.7 src/external/bsd/jemalloc/dist/src/pages.c:1.8
--- src/external/bsd/jemalloc/dist/src/pages.c:1.7	Mon Sep 23 11:03:42 2024
+++ src/external/bsd/jemalloc/dist/src/pages.c	Wed Sep 25 20:04:27 2024
@@ -132,6 +132,7 @@ os_pages_map(void *addr, size_t size, si
 	 * of existing mappings, and we only want to create new mappings.
 	 */
 	{
+		int flags = mmap_flags;
 #ifdef __NetBSD__
 		/*
 		 * On NetBSD PAGE for a platform is defined to the
@@ -141,12 +142,12 @@ os_pages_map(void *addr, size_t size, si
 		 */
 		if (alignment > os_page || PAGE > os_page) {
 			unsigned int a = ilog2(MAX(alignment, PAGE));
-			mmap_flags |= MAP_ALIGNED(a);
+			flags |= MAP_ALIGNED(a);
 		}
 #endif
 		int prot = *commit ? PAGES_PROT_COMMIT : PAGES_PROT_DECOMMIT;
 
-		ret = mmap(addr, size, prot, mmap_flags, PAGES_FD_TAG, 0);
+		ret = mmap(addr, size, prot, flags, PAGES_FD_TAG, 0);
 	}
 	assert(ret != NULL);
 

Reply via email to