From owner-svn-src-all@FreeBSD.ORG Sat Nov 21 10:21:20 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D9301065679; Sat, 21 Nov 2009 10:21:20 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:7b8:613:100::211]) by mx1.freebsd.org (Postfix) with ESMTP id 088F08FC12; Sat, 21 Nov 2009 10:21:19 +0000 (UTC) Received: by palm.hoeg.nl (Postfix, from userid 1000) id EDB3B1CCDF; Sat, 21 Nov 2009 11:21:14 +0100 (CET) Date: Sat, 21 Nov 2009 11:21:14 +0100 From: Ed Schouten To: Jung-uk Kim Message-ID: <20091121102114.GK64905@hoeg.nl> References: <200911202112.nAKLCe35056653@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="W9OqCIgVwV7zeaDP" Content-Disposition: inline In-Reply-To: <200911202112.nAKLCe35056653@svn.freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) 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 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Nov 2009 10:21:20 -0000 --W9OqCIgVwV7zeaDP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, * Jung-uk Kim 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 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--