summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortedu <tedu@openbsd.org>2012-06-26 21:36:25 +0000
committertedu <tedu@openbsd.org>2012-06-26 21:36:25 +0000
commitfeb91ba6d2208665edc0aa1d93eb67f3cffd2f91 (patch)
tree7b62dfe99c1b54807da7d4b4cd4d888826356351
parentIt is time to bring this back alive. (diff)
downloadwireguard-openbsd-feb91ba6d2208665edc0aa1d93eb67f3cffd2f91.tar.xz
wireguard-openbsd-feb91ba6d2208665edc0aa1d93eb67f3cffd2f91.zip
after a talk with ariane, use MAP_FIXED for mquery to avoid the cost of
scanning for free space if the hint isn't available. also, on further inspection, this will prevent pmap_prefer from "improving" our hint.
-rw-r--r--lib/libc/stdlib/malloc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/stdlib/malloc.c b/lib/libc/stdlib/malloc.c
index 7a48a0f2ff4..7cab70585d9 100644
--- a/lib/libc/stdlib/malloc.c
+++ b/lib/libc/stdlib/malloc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: malloc.c,v 1.144 2012/06/22 01:30:17 tedu Exp $ */
+/* $OpenBSD: malloc.c,v 1.145 2012/06/26 21:36:25 tedu Exp $ */
/*
* Copyright (c) 2008 Otto Moerbeek <otto@drijf.net>
*
@@ -95,7 +95,7 @@
MAP_ANON | MAP_PRIVATE, -1, (off_t) 0)
#define MQUERY(a, sz) mquery((a), (size_t)(sz), PROT_READ | PROT_WRITE, \
- MAP_ANON | MAP_PRIVATE, -1, (off_t)0)
+ MAP_ANON | MAP_PRIVATE | MAP_FIXED, -1, (off_t)0)
struct region_info {
void *p; /* page; low bits used to mark chunks */