From 5c4b2b5c3e79795cb4b942420b13acf74e4ab6b6 Mon Sep 17 00:00:00 2001 From: Cory Zimmerman Date: Sat, 6 Jul 2024 22:08:32 -0700 Subject: [PATCH 1/2] api revisions for zero-alloc sendmmsg and recvmmsg --- src/sys/socket/mod.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sys/socket/mod.rs b/src/sys/socket/mod.rs index cb7618a932..7375bae6bc 100644 --- a/src/sys/socket/mod.rs +++ b/src/sys/socket/mod.rs @@ -1506,7 +1506,7 @@ pub fn sendmmsg<'a, XS, AS, C, I, S>( flags: MsgFlags ) -> crate::Result> where - XS: IntoIterator, + XS: IntoIterator, AS: AsRef<[Option]>, I: AsRef<[IoSlice<'a>]> + 'a, C: AsRef<[ControlMessage<'a>]> + 'a, @@ -1657,11 +1657,11 @@ pub fn recvmmsg<'a, XS, S, I>( mut timeout: Option, ) -> crate::Result> where - XS: IntoIterator, + XS: IntoIterator, I: AsMut<[IoSliceMut<'a>]> + 'a, { let mut count = 0; - for (i, (slice, mmsghdr)) in slices.into_iter().zip(data.items.iter_mut()).enumerate() { + for (i, (mut slice, mmsghdr)) in slices.into_iter().zip(data.items.iter_mut()).enumerate() { let p = &mut mmsghdr.msg_hdr; p.msg_iov = slice.as_mut().as_mut_ptr().cast(); p.msg_iovlen = slice.as_mut().len() as _; From 6c03e6dd2469aafc90f70cd934cf123b6ad0c554 Mon Sep 17 00:00:00 2001 From: Cory Zimmerman Date: Sat, 6 Jul 2024 22:35:29 -0700 Subject: [PATCH 2/2] add 2459.changed.md --- changelog/2459.changed.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog/2459.changed.md diff --git a/changelog/2459.changed.md b/changelog/2459.changed.md new file mode 100644 index 0000000000..32ba83690e --- /dev/null +++ b/changelog/2459.changed.md @@ -0,0 +1 @@ +Change generics on `recvmmsg` and `sendmmsg` to support memory reuse. \ No newline at end of file