svn commit: r199615 - in head/sys: amd64/amd64 i386/i386 net
Ed Schouten
ed at 80386.nl
Sat Nov 21 10:21:20 UTC 2009
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)?
--
Ed Schouten <ed at 80386.nl>
WWW: http://80386.nl/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/svn-src-head/attachments/20091121/3be672cd/attachment.pgp
More information about the svn-src-head
mailing list