This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


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

Re: valarray assignment


Philip Charlton <charlton@ligo.caltech.edu> writes:

| what I was going to ask was, in valarray assignment it seems that no check
| for self-assignment is made, instead __valarray_copy() is called which
| immediately calls memcpy() to do the copying. Was this choice made
| for efficiency, to avoid the overhead of an "if" statement?

I've already replied to a private email from Philip.  I'll make
another public answer here for future reference.

The library specification makes some form of non-aliasing and
parallelim assumptions; those includes non self-assignments.

-- Gaby
CodeSourcery, LLC                       http://www.codesourcery.com


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