diff --git a/sys/arch/macppc/stand/ofwboot/alloc.c b/sys/arch/macppc/stand/ofwboot/alloc.c index 9be0311dcdad..3908ef3340ba 100644 --- a/sys/arch/macppc/stand/ofwboot/alloc.c +++ b/sys/arch/macppc/stand/ofwboot/alloc.c @@ -1,4 +1,4 @@ -/* $NetBSD: alloc.c,v 1.7 2006/01/25 18:28:27 christos Exp $ */ +/* $NetBSD: alloc.c,v 1.8 2006/01/27 02:39:07 uwe Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -129,7 +129,9 @@ void * alloc(size_t size) { struct ml *f, *bestf; +#ifndef ALLOC_FIRST_FIT unsigned bestsize = 0xffffffff; /* greater than any real size */ +#endif char *help; int failed; @@ -149,9 +151,10 @@ alloc(size_t size) f = f->list.le_next) /* noop */ ; bestf = f; - failed = (bestf == (struct fl *)0); + failed = (bestf == NULL); #else /* scan freelist */ + bestf = NULL; /* XXXGCC: -Wuninitialized */ f = freelist.lh_first; while (f != NULL) { if ((size_t)f->size >= size) { @@ -177,7 +180,7 @@ alloc(size_t size) * to page size, and record the chunk size. */ size = roundup(size, NBPG); - help = OF_claim(0, (unsigned)size, NBPG); + help = OF_claim(NULL, (unsigned)size, NBPG); if (help == (char *)-1) panic("alloc: out of memory"); @@ -193,7 +196,9 @@ alloc(size_t size) /* we take the best fit */ f = bestf; +#ifndef ALLOC_FIRST_FIT found: +#endif /* remove from freelist */ LIST_REMOVE(f, list); help = (char *)f;