Skip to content

os: drop unnecessary memcpy in wl_os_mremap_maymove

Simon Ser requested to merge emersion/wayland:fbsd-mremap-memcpy into main

FreeBSD doesn't support mremap 1, so we have a fallback implementation based on munmap+mmap. We memcpy from the old memory region to the new one, however this is unnecessary because the new mapping references the same file as the old one.

Use msync to make sure any pending write is flushed to the underlying file before we map the new region.

Signed-off-by: Simon Ser contact@emersion.fr

cc @daniels @pq @arichardson

Merge request reports