From b479cef70127ec6d1240b53ff1047e795971357c Mon Sep 17 00:00:00 2001 From: yamt Date: Wed, 5 Nov 2003 15:34:50 +0000 Subject: [PATCH] don't move hint backward. --- sys/uvm/uvm_map.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sys/uvm/uvm_map.c b/sys/uvm/uvm_map.c index f547f6a448e8..94d769fab40e 100644 --- a/sys/uvm/uvm_map.c +++ b/sys/uvm/uvm_map.c @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_map.c,v 1.148 2003/11/05 15:09:09 yamt Exp $ */ +/* $NetBSD: uvm_map.c,v 1.149 2003/11/05 15:34:50 yamt Exp $ */ /* * Copyright (c) 1997 Charles D. Cranor and Washington University. @@ -71,7 +71,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.148 2003/11/05 15:09:09 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.149 2003/11/05 15:34:50 yamt Exp $"); #include "opt_ddb.h" #include "opt_uvmhist.h" @@ -1507,9 +1507,11 @@ nextgap: * space requirement */ if (topdown) { - hint = tmp->next->start - length; + if (hint > tmp->next->start - length) + hint = tmp->next->start - length; } else { - hint = tmp->end; + if (hint < tmp->end) + hint = tmp->end; } switch (uvm_map_space_avail(&hint, length, uoffset, align, topdown, tmp)) {