From owner-svn-src-all@FreeBSD.ORG Mon Nov 23 17:02:24 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 962F61065672; Mon, 23 Nov 2009 17:02:24 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: Ed Schouten Date: Mon, 23 Nov 2009 12:02:07 -0500 User-Agent: KMail/1.6.2 References: <200911202112.nAKLCe35056653@svn.freebsd.org> <20091121102114.GK64905@hoeg.nl> In-Reply-To: <20091121102114.GK64905@hoeg.nl> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200911231202.11209.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 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: Mon, 23 Nov 2009 17:02:24 -0000 On Saturday 21 November 2009 05:21 am, Ed Schouten wrote: > Hi, > > * Jung-uk Kim 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