From b956e06272dda62e55ac2cd7793273f56d1960ac Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Tue, 7 Jul 1992 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 1992-07-07 --- port/alloc.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/port/alloc.c b/port/alloc.c index fdb25ce2d695fb1ebc4e8303899e84e03b04f28f..49e28f2e7ee26f16d0ffad94e382016848d4514a 100644 --- a/port/alloc.c +++ b/port/alloc.c @@ -3,6 +3,7 @@ #include "mem.h" #include "dat.h" #include "fns.h" +#include "error.h" /* * Plan 9 has two kernel allocators, the x... routines provide a first @@ -19,7 +20,7 @@ enum { - Maxpow = 16, + Maxpow = 18, Nhole = 128, Magichole = 0xDeadBabe, Magic2n = 0xFeedBeef, @@ -260,7 +261,7 @@ malloc(ulong size) int pow; Bucket *bp; - for(pow = 3; pow < Maxpow; pow++) + for(pow = 3; pow <= Maxpow; pow++) if(size <= (1<p->psstate = s; } - return p; + pexit(Enomem, 1); + return 0; } int