mozilla / audioipc

Cubeb Audio Remoting For Gecko
10 stars 17 forks source link

audioipc: Try `shm_open` before falling back to temp file. #119

Closed kinetiknz closed 3 years ago

kinetiknz commented 3 years ago

Try creating a shared memory segment via shm_open before falling back to a temporary file. This is a better approach for macOS and other systems lacking memfd.

shm_unlink is called immediately after a successful shm_open to minimize the lifetime of the shared memory segment name; the underlying shared memory segment is kept alive by the fd returned by shm_open and the fd we later clone to the client to use in SharedMem::from.