/* This function will move memory content from source address to destination address. If the destination memory does not overlap with the source memory, the function is the same as memcpy().  */
void* rt_memmove(void *dest, const void *src, rt_size_t n)
/* This function will move memory content from source address to destination address. If the destination memory does not overlap with the source memory, the function is the same as memcpy().  */
void* rt_memmove(void *dest, const void *src, rt_size_t n)
{
    char *tmp = (char *)dest, *s = (char *)src;
    if (s < tmp && tmp < s + n)
    {
        tmp += n;
        s += n;
        while (n--)
            *(--tmp) = *(--s);
    }
    else
    {
        while (n--)
            *tmp++ = *s++;
    }
    return dest;
}