svn commit: r316613 - in stable/11/lib/libc: gen iconv net regex rpc stdio stdlib

Brooks Davis brooks at freebsd.org
Sat Apr 8 00:28:56 UTC 2017


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
> > 
> > Log:
> >   MFC r315162:
> >   libc: provide some bounds-checking through reallocarray(3).
> >   
> >   reallocarray(3) is a non portable extension that originated in OpenBSD.
> >   Given that it is already in FreeBSD's libc it is useful for the cases
> >   where reallocation involves a multiplication.
...
> 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/svn-src-stable/attachments/20170408/7576897b/attachment.sig>


More information about the svn-src-stable mailing list