Module Name:    src
Committed By:   christos
Date:           Fri Apr 26 23:57:59 UTC 2019

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

Log Message:
Enforce alignment also if the compiled in PAGE_SIZE is bigger than
getpagesize()


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 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.4 src/external/bsd/jemalloc/dist/src/pages.c:1.5
--- src/external/bsd/jemalloc/dist/src/pages.c:1.4	Fri Apr 26 10:58:56 2019
+++ src/external/bsd/jemalloc/dist/src/pages.c	Fri Apr 26 19:57:59 2019
@@ -79,9 +79,10 @@ os_pages_map(void *addr, size_t size, si
 	{
 		int flags = mmap_flags;
 #ifdef MAP_ALIGNED
-		int a = ilog2(alignment);
-		if (a > LG_PAGE && a < ilog2(sizeof(void *)))
+		if (alignment > os_page || PAGE > os_page) {
+			int a = ilog2(MAX(alignment, PAGE));
 			flags |= MAP_ALIGNED(a);
+		}
 #endif
 		int prot = *commit ? PAGES_PROT_COMMIT : PAGES_PROT_DECOMMIT;
 

Reply via email to