9os

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit fc4a6566987652a6f0b1a68bcbe699b14f6ee96f
parent 43be64fccc4807ec2802d7424818d6392e2c38e8
Author: Roberto E. Vargas Caballero <roberto.vargas@midokura.com>
Date:   Sat, 19 Nov 2022 08:34:26 +0100

os9: Simplify morepages()

Diffstat:
Msrc/os9/alloc.c | 9++-------
1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/src/os9/alloc.c b/src/os9/alloc.c @@ -91,9 +91,7 @@ alloc(size_t size) static int morepages(void) { - int i; - void *bp; - Page *p, *ptable; + Page *p, *bp; if (pagepool.list) return 1; @@ -101,11 +99,8 @@ morepages(void) if ((bp = allocb()) == NULL) return 0; - ptable = bp; - for (i = 0; i < PAGESIZE/sizeof(Page); i++) { - p = &ptable[i]; + for (p = bp; p < &bp[PAGESIZE/sizeof(Page)]; ++p) p->next = p+1; - } p->next = NULL; pagepool.list = bp;