This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] strcpy optimizations


On 01/29/13 13:53, OndÅej BÃlka wrote:
> I wanted to use it only to bytes which change.

Sorry, I don't follow.

> There is problem with code like this:
> struct foo {
>   long x;
>   char y[8];
>   long z;
> }
> foo f;
> 
> With f.x++;              in first thread
> With f.z++;              in second thread
> and  strcpy (f.y, "abc") in third thread.

The behavior of strcpy is undefined in that case.
So strcpy can do whatever it likes, and
that includes using the pblendvb instruction.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]