How to implement memmove in standard C without an intermediate copy?
I think you’re right, it’s not possible to implement memmove efficiently in standard C. The only truly portable way to test whether the regions overlap, I think, is something like this: for (size_t l = 0; l < len; ++l) { if (src + l == dst) || (src + l == dst + len … Read more