From 201c3d4b18fa0965b1e0708c7a9fe9e5468cd26c Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Mon, 31 Jan 2000 03:42:03 +0000 Subject: [PATCH] Simplify previous change. --- v7/src/microcode/ux.c | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/v7/src/microcode/ux.c b/v7/src/microcode/ux.c index faff93a99..8e2bb6e4b 100644 --- a/v7/src/microcode/ux.c +++ b/v7/src/microcode/ux.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: ux.c,v 1.18 2000/01/31 03:32:37 cph Exp $ +$Id: ux.c,v 1.19 2000/01/31 03:42:03 cph Exp $ Copyright (c) 1990-2000 Massachusetts Institute of Technology @@ -656,21 +656,13 @@ void * freebsd_heap_malloc (unsigned long requested_length) { unsigned long ps = (getpagesize ()); - char * p = ((char *) ps); - void * addr; - while (p < 0x04000000) - { - addr - = (mmap (p, - (((requested_length + (ps - 1)) / ps) * ps), - (PROT_EXEC | PROT_READ | PROT_WRITE), - (MAP_PRIVATE | MAP_ANON | MAP_FIXED), - (-1), 0)); - if (addr != MAP_FAILED) - return (addr); - p += ps; - } - return (0); + void * addr + = (mmap (((void *) ps), + (((requested_length + (ps - 1)) / ps) * ps), + (PROT_EXEC | PROT_READ | PROT_WRITE), + (MAP_PRIVATE | MAP_ANON | MAP_FIXED), + (-1), 0)); + return ((addr == MAP_FAILED) ? 0 : addr); } #endif /* __FreeBSD__ */ -- 2.25.1