Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 Jan 2003 14:21:25 -0500
From:      Hiten Pandya <hiten@unixdaemons.com>
To:        Nate Lawson <nate@root.org>
Cc:        Hidetoshi Shimokawa <simokawa@FreeBSD.ORG>, cvs-all@FreeBSD.ORG, cvs-committers@FreeBSD.ORG
Subject:   Re: cvs commit: src/sys/dev/firewire firewire.c fwdev.c fwohci.c fwohcivar.h
Message-ID:  <20030116192125.GA24866@unixdaemons.com>
In-Reply-To: <Pine.BSF.4.21.0301161007080.46845-100000@root.org>
References:  <20030116130939.3C65A37B4CD@hub.freebsd.org> <Pine.BSF.4.21.0301161007080.46845-100000@root.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Jan 16, 2003 at 10:10:29AM -0800, Nate Lawson wrote the words in effect of:
> On Thu, 16 Jan 2003, Hidetoshi Shimokawa wrote:
> >   Modified files:
> >     sys/dev/firewire     firewire.c fwdev.c fwohci.c fwohcivar.h 
> >   Log:
> >   Improve memory allocation.
> >   - Don't use contigmalloc() and allocate page by page to avoid
> >           allocation failure.
> >   - allocate buffer by PAGE_SIZE.
> 
> Some comments.
> 
> > -		contigfree((void *)(uintptr_t)sc->fc.sid_buf,
> > -					OHCI_SIDSIZE, M_DEVBUF);
> > +		free((void *)(uintptr_t)sc->fc.sid_buf, M_DEVBUF);
> 
> Unnecessary casts (there are others).
> 
> >  		malloc(sizeof(struct fwohcidb_tr) * dbch->ndb,
> >  		M_DEVBUF, M_DONTWAIT | M_ZERO);
> 
> The correct flag is M_NOWAIT.  You should do a global sed on this in your
> code.

Hmm, I think it's about time we add this NOTE to the malloc(9) manual
page.

-- 
Hiten Pandya (hiten@unixdaemons.com, hiten@uk.FreeBSD.org)
http://www.unixdaemons.com/~hiten/

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030116192125.GA24866>