Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 21 Nov 2009 11:21:14 +0100
From:      Ed Schouten <ed@80386.nl>
To:        Jung-uk Kim <jkim@FreeBSD.org>
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:  <20091121102114.GK64905@hoeg.nl>
In-Reply-To: <200911202112.nAKLCe35056653@svn.freebsd.org>
References:  <200911202112.nAKLCe35056653@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--W9OqCIgVwV7zeaDP
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hi,

* Jung-uk Kim <jkim@FreeBSD.org> wrote:
>  #ifdef _KERNEL
> -	stream.refs =3D malloc((nins + 1) * sizeof(u_int), M_BPFJIT, M_NOWAIT);
> +	stream.refs =3D malloc((nins + 1) * sizeof(u_int), M_BPFJIT,
> +	    M_NOWAIT | M_ZERO);
>  #else
>  	stream.refs =3D malloc((nins + 1) * sizeof(u_int));
>  #endif
>  	if (stream.refs =3D=3D NULL)
>  		return (NULL);
> -
> -	/* Reset the reference table */
> -	for (i =3D 0; i < nins + 1; i++)
> -		stream.refs[i] =3D 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)?

--=20
 Ed Schouten <ed@80386.nl>
 WWW: http://80386.nl/

--W9OqCIgVwV7zeaDP
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (FreeBSD)

iEUEARECAAYFAksHvxoACgkQ52SDGA2eCwX3AACXbZnEcesb8eGpyWsK170DcrR8
PQCfaJbjZBsrlFnuorOjDvoVAG8pNMM=
=AcwQ
-----END PGP SIGNATURE-----

--W9OqCIgVwV7zeaDP--



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