You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently sendmsg allocates a new vector for cmsg_buffer every time it is called. It would be nice if it could accept a mutable reference to Vec instead so it can reuse existing storage instead or &mut [u8], perhaps as an option?
The text was updated successfully, but these errors were encountered:
Hi, it would be nice to avoid heap allocations here, but if we allow users to pass a pre-allocated cmsg buffer, then users have to ensure that:
The buffer is zero-initialized
The buffer is sufficient in size
For 1, Nix can guarantee this by (possibly) re-initializing it. For 2, if we use a vector and it is insufficient, we can re-allocate to extend the capacity.
Perhaps we should provide an alternative interface? Something like sendmsg_pre_alloc()?
Currently
sendmsg
allocates a new vector for cmsg_buffer every time it is called. It would be nice if it could accept a mutable reference toVec
instead so it can reuse existing storage instead or&mut [u8]
, perhaps as an option?The text was updated successfully, but these errors were encountered: