diff options
author | 2013-04-17 23:22:42 +0000 | |
---|---|---|
committer | 2013-04-17 23:22:42 +0000 | |
commit | 1dd1a2a79d47315345ef152312159cf6e058aacc (patch) | |
tree | fc640f2d433ee58e66c4327c2c74e59024480c3d | |
parent | Also accelerate scrolling backwards. (diff) | |
download | wireguard-openbsd-1dd1a2a79d47315345ef152312159cf6e058aacc.tar.xz wireguard-openbsd-1dd1a2a79d47315345ef152312159cf6e058aacc.zip |
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
-rw-r--r-- | sys/uvm/uvm_map.c | 5 |
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 |