svn commit: r199615 - in head/sys: amd64/amd64 i386/i386 net
Jung-uk Kim
jkim at FreeBSD.org
Mon Nov 23 17:02:24 UTC 2009
On Saturday 21 November 2009 05:21 am, Ed Schouten wrote:
> Hi,
>
> * Jung-uk Kim <jkim at 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
More information about the svn-src-head
mailing list