memcpy and alternatives..

Started by
4 comments, last by meZmo 22 years, 3 months ago
How is memcpy really implemented? How large data blocks do I have to copy before memcpy gets more efficient than regular assignments, or copying packed data with SSE? -meZ Edited by - meZmo on January 15, 2002 3:06:43 PM
Advertisement
run your program through the VC++ debugger. and step through the "memcpy" function...

To the vast majority of mankind, nothing is more agreeable than to escape the need for mental exertion... To most people, nothing is more troublesome than the effort of thinking.
To the vast majority of mankind, nothing is more agreeable than to escape the need for mental exertion... To most people, nothing is more troublesome than the effort of thinking.
if you want to see the "memcpy" code in optimized mode create a release program with the "memcpy" function and disassemble the program.

To the vast majority of mankind, nothing is more agreeable than to escape the need for mental exertion... To most people, nothing is more troublesome than the effort of thinking.
To the vast majority of mankind, nothing is more agreeable than to escape the need for mental exertion... To most people, nothing is more troublesome than the effort of thinking.
But what's this crazy thing I hear about memcpy "sometimes" being inlined, and sometimes not? Is this something I can control, or is this just plain BS?

Edited by - meZmo on January 15, 2002 3:15:25 PM
i believe it uses inline "memcpy" when data is aligned on a 32-bit boundary.

To the vast majority of mankind, nothing is more agreeable than to escape the need for mental exertion... To most people, nothing is more troublesome than the effort of thinking.
To the vast majority of mankind, nothing is more agreeable than to escape the need for mental exertion... To most people, nothing is more troublesome than the effort of thinking.
ok. thx.

This topic is closed to new replies.

Advertisement