Date: Mon, 23 Nov 2009 12:02:07 -0500 From: Jung-uk Kim <jkim@FreeBSD.org> To: Ed Schouten <ed@80386.nl> Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r199615 - in head/sys: amd64/amd64 i386/i386 net Message-ID: <200911231202.11209.jkim@FreeBSD.org> In-Reply-To: <20091121102114.GK64905@hoeg.nl> References: <200911202112.nAKLCe35056653@svn.freebsd.org> <20091121102114.GK64905@hoeg.nl>
next in thread | previous in thread | raw e-mail | index | archive | help
On Saturday 21 November 2009 05:21 am, Ed Schouten wrote: > Hi, > > * Jung-uk Kim <jkim@FreeBSD.org> wrote: > > #ifdef _KERNEL > > - stream.refs = malloc((nins + 1) * sizeof(u_int), M_BPFJIT, > > M_NOWAIT); + stream.refs = malloc((nins + 1) * sizeof(u_int), > > M_BPFJIT, + M_NOWAIT | M_ZERO); > > #else > > stream.refs = malloc((nins + 1) * sizeof(u_int)); > > #endif > > if (stream.refs == NULL) > > return (NULL); > > - > > - /* Reset the reference table */ > > - for (i = 0; i < nins + 1; i++) > > - stream.refs[i] = 0; > > +#ifndef _KERNEL > > + memset(stream.refs, 0, (nins + 1) * sizeof(u_int)); > > +#endif > > Can't we avoid the special case here by just calling calloc(3)? Good point, will be done in the next patch set. Thanks, Jung-uk Kim
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200911231202.11209.jkim>