assemblyarmmemcpycortex-m

gcc efficient byte copy for ARM Cortex-M4


Is there a built-in gcc memcopy function that is specifically optimized to the architecture of the ARM Cortex-M4?


Solution

  • Yes - memcpy. Compilers and standard libraries generally have well-optimised versions of memcpy for each target platform. That's not to say that you can't beat the speed of memcpy in specific situations with knowledge of the nature of the data and its alignment, but in general you should trust the writers of the standard library to have done a good job. See this question and its answers.