On Saturday 21 November 2009 05:21 am, Ed Schouten wrote:
> Hi,
>
> * Jung-uk Kim <j...@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
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to