You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2019/03/26 16:31:48 UTC

[GitHub] [mynewt-nimble] rymanluk commented on a change in pull request #380: [WP] nimble/host: Improve usage of MSYS

rymanluk commented on a change in pull request #380: [WP] nimble/host: Improve usage of MSYS
URL: https://github.com/apache/mynewt-nimble/pull/380#discussion_r269200003
 
 

 ##########
 File path: nimble/host/src/ble_hs_mbuf.c
 ##########
 @@ -84,6 +98,50 @@ ble_hs_mbuf_l2cap_pkt(void)
     return ble_hs_mbuf_gen_pkt(BLE_HCI_DATA_HDR_SZ + BLE_L2CAP_HDR_SZ);
 }
 
+#if MYNEWT_VAL(BLE_HS_OWN_MBUF_FOR_HEADERS)
+/**
+ * Allocates an mbuf for use by the nimble host.
+ */
+static struct os_mbuf *
+ble_hs_mbuf_gen_hdr_pkt(uint16_t leading_space)
+{
+    struct os_mbuf *om;
+    int rc;
+
+    om = os_mbuf_get_pkthdr(&ble_hs_hdr_mbuf_pool, leading_space);
+    if (om == NULL) {
+        return NULL;
+    }
+
+    if (om->om_omp->omp_databuf_len < leading_space) {
+        rc = os_mbuf_free_chain(om);
 
 Review comment:
   agree

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services