Module Name: src
Committed By: christos
Date: Sat Mar 16 22:14:09 UTC 2019
Modified Files:
src/external/bsd/jemalloc/dist/src: pages.c
Log Message:
we have MAP_ALIGNED, so use it (although it does not do anything by default)
To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 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.1.1.1 src/external/bsd/jemalloc/dist/src/pages.c:1.2
--- src/external/bsd/jemalloc/dist/src/pages.c:1.1.1.1 Mon Mar 4 12:10:23 2019
+++ src/external/bsd/jemalloc/dist/src/pages.c Sat Mar 16 18:14:08 2019
@@ -14,6 +14,9 @@
#include <vm/vm_param.h>
#endif
#endif
+#ifdef MAP_ALIGNED
+#include <sys/bitops.h> /* NetBSD */
+#endif
/******************************************************************************/
/* Data. */
@@ -74,9 +77,15 @@ 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 MAP_ALIGNED
+ int a = ilog2(alignment);
+ if (a > LG_PAGE && a < ilog2(sizeof(void *)))
+ flags |= MAP_ALIGNED(a);
+#endif
int prot = *commit ? PAGES_PROT_COMMIT : PAGES_PROT_DECOMMIT;
- ret = mmap(addr, size, prot, mmap_flags, -1, 0);
+ ret = mmap(addr, size, prot, flags, -1, 0);
}
assert(ret != NULL);