[PATCH] Improve strncpy performance further
Wilco Dijkstra
wdijkstr@arm.com
Sun Jan 11 18:11:00 GMT 2015
> Roland McGrath wrote:
> > Btw while on the subject on namespaces, is bcopy correctly defined?
> > After a lot of complex inclusion and defines, it ultimately does:
> >
> > void
> > bcopy ()
> > {
> > ...
> > }
>
> I'm not sure what kind of correctness you have in mind. bcopy is the only
> name under which that function needs to be defined. If it's in the same
> file as a standard function (presumably memmove) then it needs to be
> defined as weak. No other code anywhere in libc should call bcopy (we'd
> use memmove or memcpy instead), so it doesn't need to have an __ name.
Well, bcopy and bzero are both used in several non-test sources in GLIBC,
but one is always defined as __bzero, and the other as bcopy.
It's unclear to me what the exact namespace rules are (or whether there is
even a concise description of them somewhere), however it is obvious that
this is not consistent. Note any rule that relies on whether a function is
called or not from within the same library is risky unless you have
automated checks to catch that.
Wilco
More information about the Libc-alpha
mailing list