From 9467a6c5a9861b765de64c3a7fac7a49c83c6cfc Mon Sep 17 00:00:00 2001 From: Alex Saveau Date: Sun, 15 Dec 2024 18:32:23 -0500 Subject: [PATCH] Remove a pointless allocation The stack size is 152 bytes which is teeny. --- wayland-backend/src/rs/socket.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wayland-backend/src/rs/socket.rs b/wayland-backend/src/rs/socket.rs index 94170d233ae..4d6b286fece 100644 --- a/wayland-backend/src/rs/socket.rs +++ b/wayland-backend/src/rs/socket.rs @@ -75,7 +75,7 @@ impl Socket { #[cfg(target_os = "macos")] let flags = RecvFlags::DONTWAIT; - let mut cmsg_space = vec![0; rustix::cmsg_space!(ScmRights(MAX_FDS_OUT))]; + let mut cmsg_space = [0; rustix::cmsg_space!(ScmRights(MAX_FDS_OUT))]; let mut cmsg_buffer = RecvAncillaryBuffer::new(&mut cmsg_space); let mut iov = [IoSliceMut::new(buffer)]; let msg = retry_on_intr(|| recvmsg(&self.stream, &mut iov[..], &mut cmsg_buffer, flags))?;