Skip to content

Commit

Permalink
Remove a pointless allocation
Browse files Browse the repository at this point in the history
The stack size is 152 bytes which is teeny.
  • Loading branch information
SUPERCILEX authored and ids1024 committed Dec 23, 2024
1 parent 6049eab commit 9467a6c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion wayland-backend/src/rs/socket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))?;
Expand Down

0 comments on commit 9467a6c

Please sign in to comment.