summaryrefslogtreecommitdiff
path: root/sys/uvm/uvm_map.c
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2013-04-17 23:22:43 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2013-04-17 23:22:43 +0000
commit323aa6964262d57c36011826e0e2180bf4eb5210 (patch)
treebdb30c1e90243b6f7c7ba1c7e75426bc1fbef50c /sys/uvm/uvm_map.c
parent71f71adbe039167999dee8f9be61b498a8cb33bc (diff)
it is better if we always start addr at something reasonable, and
then move it up. previous revision would leave addr uninitialized. pointed out by oga at nicotinebsd.org
Diffstat (limited to 'sys/uvm/uvm_map.c')
-rw-r--r--sys/uvm/uvm_map.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/uvm/uvm_map.c b/sys/uvm/uvm_map.c
index 40b50993d66..e5496f4e0ee 100644
--- a/sys/uvm/uvm_map.c
+++ b/sys/uvm/uvm_map.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_map.c,v 1.160 2013/04/17 17:46:53 tedu Exp $ */
+/* $OpenBSD: uvm_map.c,v 1.161 2013/04/17 23:22:42 tedu Exp $ */
/* $NetBSD: uvm_map.c,v 1.86 2000/11/27 08:40:03 chs Exp $ */
/*
@@ -3658,13 +3658,14 @@ uvm_map_hint(struct vmspace *vm, vm_prot_t prot)
spacing = (MIN((256 * 1024 * 1024), BRKSIZ) - 1);
+ addr = (vaddr_t)vm->vm_daddr;
/*
* Start malloc/mmap after the brk.
* If the random spacing area has been used up,
* the brk area becomes fair game for mmap as well.
*/
if (vm->vm_dused < spacing >> PAGE_SHIFT)
- addr = (vaddr_t)vm->vm_daddr + BRKSIZ;
+ addr += BRKSIZ;
#if !defined(__vax__)
addr += arc4random() & spacing;
#endif