memmove and memcpy improvement