You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/01/04 13:41:22 UTC

[GitHub] [incubator-nuttx] pkarashchenko commented on a change in pull request #5156: net/usrsock: add support for CONFIG_NET_ALLOC_CONNS

pkarashchenko commented on a change in pull request #5156:
URL: https://github.com/apache/incubator-nuttx/pull/5156#discussion_r778088951



##########
File path: net/usrsock/usrsock_conn.c
##########
@@ -45,7 +46,9 @@
 
 /* The array containing all usrsock connections. */
 
+#ifndef CONFIG_NET_ALLOC_CONNS
 static struct usrsock_conn_s g_usrsock_connections[CONFIG_NET_USRSOCK_CONNS];
+#endif

Review comment:
       What about
   ```
   int usrsock_connidx(FAR struct usrsock_conn_s *conn)
   {
     int idx = conn - g_usrsock_connections;
   
     DEBUGASSERT(idx >= 0);
     DEBUGASSERT(idx < ARRAY_SIZE(g_usrsock_connections));
   
     return idx;
   }
   ```
   ???




-- 
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-unsubscribe@nuttx.apache.org

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