[RFC] strcpy optimizations

Paul Eggert eggert@cs.ucla.edu
Tue Jan 29 21:30:00 GMT 2013


On 01/29/13 12:15, Ondřej Bílka wrote:

> I need to know if it is safe for example to use pblendvb 
> on high 8 bytes while other thread modifies lower 8 bytes?

Why wouldn't it be safe?  If two threads strcpy into the same
buffer, or one strcpies from a buffer while another is
strcpying into that buffer, the resulting behavior is undefined,
so the GNU C library can do what it likes.  It shouldn't
matter whether pblendvb is atomic; you should be able to use it.

> Third question is what usage is worth optimizing. When I looked how 
> firefox(biggest usage on my computer) most of calls are used to copy 
> a english dictonary. I do not know what is used strncpy in font 
> configuration which also takes considerable portion

strncpy should be lower priority, I'd say.  Typically, a program
that uses strncpy doesn't care all that much about performance.



More information about the Libc-alpha mailing list