Archived

This topic is now archived and is closed to further replies.

meZmo

memcpy and alternatives..

Recommended Posts

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites