[riot-notifications] [RIOT-OS/RIOT] sys/net/gnrc_pktbuf: deduplicate code (#15839)

Marian Buschsieweke notifications at github.com
Sat Jan 23 15:32:56 CET 2021


@maribu commented on this pull request.



> +#if IS_USED(MODULE_GNRC_PKTBUF_STATIC) || DOXYGEN
+/**
+ * @brief   Release an internal buffer
+ *
+ * @warning This function is ***internal***. Use @ref gnrc_pktbuf_release to
+ *          release a packet buffer
+ *
+ * @param   data    pointer to the internal buffer to release
+ * @param   size    size of @p data in bytes
+ */
+void gnrc_pktbuf_free_internal(void *data, size_t size);
+#else
+static inline void gnrc_pktbuf_free_internal(void *data, size_t size)
+{
+    (void)size;
+    free(data);
+}
+#endif

> There are some more functions for which you can do this ;-).

Are you referring to this? This would only work, if the function would be `inline`able in both cases. But in case of the static version, I think it is better without `inline`.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/15839#pullrequestreview-574850991
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210123/2b7d2acb/attachment.htm>


More information about the notifications mailing list