memory: Optimize flatview_simplify() to eliminate redundant memmove calls
The original flatview_simplify() implementation uses memmove() to shift array elements after each merge operation, resulting in O(n²) time complexity in the worst case. This is inefficient for VMs with large memory topologies containing hundreds of MemoryRegions. Replace the memmove-based approach with a two-pointer in-place compression algorithm that achieves O(n) time complexity. The new algorithm uses a write pointer i and a read pointer j, where i ≤ j is always maintained. This invariant ensures we never overwrite unprocessed data, making memmove unnecessary. Signed-off-by: Bin Guo <guobin@linux.alibaba.com> Link: https://lore.kernel.org/r/20260331060731.82641-1-guobin@linux.alibaba.com Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>