http://unspecified.wordpress.com/2009/05/16/microsoft-bans-m...
http://unspecified.wordpress.com/2009/05/16/microsoft-bans-m...
http://msdn.microsoft.com/en-us/library/dswaw1wk(v=vs.80).as...
edit: I read the link you included and I have to take exception with this line:
it’s a perfectly safe function if you use
it properly
Sure, same thing as automobiles, alcohol, condoms… Problems arise because people do not use them correctly."If the source and destination overlap, the behavior of memcpy_s is undefined."
Wow, way to improve things microsuck! It's not like anyone has ever mistakenly used memcpy on overlapping buffers....
you know memcpy is my 'classical' example of why you should never trust library code to be well optimised. its almost always a dumbass byte-by-byte copy - its pretty much the worst case performance unless you go out of your way to slow down your implementation.
the speed improvement from good register usage and appropriate cache hints was >35% the last time i had to do this (iirc against the VS 2008 implementation)
MS provided a special memcpy variant for 360 that did this for you using the PPC dcb* instructions and good use of the wider registers.
http://nadeausoftware.com/articles/2012/05/c_c_tip_how_copy_...
no memcpy implementation has an excuse to be that slow under any compiler imo.
i'd imagine the intel guys will make use of this stuff because its why they put it in the hardware to start with... :)
incidentally, as a complete tangent, really great bunch of guys to work with if you get the chance - at least in my experience. a definite passion for and focus on performance in a serious way. :)
And most of what's in ANSI C (the first C standard, before ISO stepped in, from 1989) was in C compilers before ANSI C existed. I think void and void* were the only things ANSI C really added to the language.
My point is, the C standards body likes to standardize common usage, and 'what a Microsoft compiler does' is pretty close to being common in some parts of the world.
Didn't the POSIX standard do that, as opposed to the ANSI C standard?
It's a little amusing that MS have this optional part of C11 implemented years in advance and standardised on their work, but haven't got C99 support. It must suit them to have it that way.
Can you tell me whether the C11 Bounds checking stuff from this optional Annex K had fully made it in to GCC 4.9? If not what's missing?
On the status page here it implies the project has had issues:[0]
[0]http://gcc.gnu.org/wiki/C11Status
Yet, on the release notes it says "Substantially complete" but it's really as clear as mud whether it's all there[2].
[2]http://gcc.gnu.org/gcc-4.9/changes.html
I suppose that on Linux and Windows the intel compiler relies on the GCC/MS implementation of memcpy_s.