[riot-notifications] [RIOT-OS/RIOT] gnrc_pkt: port to list.h (#15342)

Marian Buschsieweke notifications at github.com
Tue Nov 3 12:25:35 CET 2020


@maribu commented on this pull request.



> +    list_node_t list = { .next = (list_node_t *)pkt };
+
+    list_add(&list, (list_node_t *)snip);
+    return (gnrc_pktsnip_t *)list.next;

I agree with @benpicco here. Here `list_node_t list` is allocated on the stack, so that memory become invalid after the function scope is left. I needed quite some time to confirm that `list` is indeed not used anymore once the scope of the function is left.

I'm personally a bit puzzled that this is resulted in smaller ROM size. I would personally prefer to trade in a few bytes of ROM for the increased readability.

-- 
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/15342#discussion_r516596598
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20201103/d1ead8f9/attachment.htm>


More information about the notifications mailing list