mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-11-02 09:01:39 -05:00
shm: Add mmap+memmove fallback if mremap() does not exist
Some operating systems (e.g. FreeBSD) do not implement mremap. In that case we can grow the mapping by trying to map adjacent memory. If that fails we can fall back to creating a new larger mapping and moving the old memory contents there. Co-authored-by: Koop Mast <kwm@rainbow-runner.nl> Signed-off-by: Alex Richardson <Alexander.Richardson@cl.cam.ac.uk>
This commit is contained in:
parent
54b237a612
commit
5a981ee823
4 changed files with 74 additions and 9 deletions
|
|
@ -47,6 +47,10 @@ wl_os_epoll_create_cloexec(void);
|
|||
int
|
||||
wl_os_accept_cloexec(int sockfd, struct sockaddr *addr, socklen_t *addrlen);
|
||||
|
||||
void *
|
||||
wl_os_mremap_maymove(int fd, void *old_data, ssize_t *old_size,
|
||||
ssize_t new_size, int prot, int flags);
|
||||
|
||||
|
||||
/*
|
||||
* The following are for wayland-os.c and the unit tests.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue