xiaoxiang781216 commented on code in PR #15577:
URL: https://github.com/apache/nuttx/pull/15577#discussion_r1917703775


##########
net/usrsock/usrsock_sendmsg.c:
##########
@@ -142,9 +143,18 @@ static int do_sendto_request(FAR struct usrsock_conn_s 
*conn,
   {
   };
 
-  struct iovec bufs[2 + msg->msg_iovlen];
+  struct iovec *bufs;
+  size_t iovlen;
+  int ret;
   int i;
 
+  iovlen = 2 + msg->msg_iovlen;
+  bufs = kmm_malloc(sizeof(*bufs) * iovlen);

Review Comment:
   could we use alloca or save the buffer to conn? it isn't good to do the 
allocation in the hot path.



##########
net/usrsock/usrsock_sendmsg.c:
##########
@@ -142,9 +143,18 @@ static int do_sendto_request(FAR struct usrsock_conn_s 
*conn,
   {
   };
 
-  struct iovec bufs[2 + msg->msg_iovlen];
+  struct iovec *bufs;

Review Comment:
   FAR



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to