Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 8 Apr 2017 00:28:54 +0000
From:      Brooks Davis <brooks@freebsd.org>
To:        rgrimes@freebsd.org
Cc:        "Pedro F. Giffuni" <pfg@freebsd.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   Re: svn commit: r316613 - in stable/11/lib/libc: gen iconv net regex rpc stdio stdlib
Message-ID:  <20170408002854.GB43485@spindle.one-eyed-alien.net>
In-Reply-To: <201704080019.v380JEI1057396@pdx.rh.CN85.dnsmgr.net>
References:  <201704071608.v37G84Ep031357@repo.freebsd.org> <201704080019.v380JEI1057396@pdx.rh.CN85.dnsmgr.net>

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

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

On Fri, Apr 07, 2017 at 05:19:14PM -0700, Rodney W. Grimes wrote:
> [ Charset UTF-8 unsupported, converting... ]
> > Author: pfg
> > Date: Fri Apr  7 16:08:04 2017
> > New Revision: 316613
> > URL: https://svnweb.freebsd.org/changeset/base/316613
> >=20
> > Log:
> >   MFC r315162:
> >   libc: provide some bounds-checking through reallocarray(3).
> >  =20
> >   reallocarray(3) is a non portable extension that originated in OpenBS=
D.
> >   Given that it is already in FreeBSD's libc it is useful for the cases
> >   where reallocation involves a multiplication.
=2E..
> I am not sure, but isnt this a code pessimization as you now push
> an extra arg on the stack, and also remove the possiblity of compile
> time const calculation of foo * bar?

I'd be pretty surprised if that was even possible to measure the
several cycles your talking about.  Even ignoring TLB misses, the
realloc/reallocarray call is going to burn thousands of cycles and blow
much of your low level I-CACHE and probably D-CACHE.

-- Brooks

--vGgW1X5XWziG23Ko
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQEcBAEBAgAGBQJY6C7GAAoJEKzQXbSebgfAu3wH/2rT6tkKXhSqmWyotEeyNtrz
fg9uurKKfwKH6nMbSThvHlBij5nClcSQvjEubksLfZm9lPpSHN9NDhYl4m+oa2GL
Jz2OypWlPqTGiyzS1x2HsXSG1mym9IdMc5XokVHb7p7lA4/Mi+RgEKXT6Yy5c9Gu
/KXW7ng3QPgblykjFMbEO9fmwEcj2cbR2abTuGT4UlrfuHPDp4YQgWSdBW1gK/FB
5A/Yte6Cb4I+aWXPCF3xvbJCCZDCh5PhB52zZiT5S065i/Q7mBdhxrXihW0mdDkY
Jb1Bj2aBTTNG9EQt+BWVIwM8yYLzMIhKrcifnzBbs1TlD/rMTWNic6dnhYYBVew=
=RY07
-----END PGP SIGNATURE-----

--vGgW1X5XWziG23Ko--



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