Skip to content
Commit bb780eff authored by Jordan Yates's avatar Jordan Yates Committed by Johan Hedberg
Browse files

net: buf: move `user_data` to flexible arr member



Transition the `user_data` field in `struct net_buf` to be a flexible
array member instead of a hardcoded array. Compile-time asserts are
introduced at the location of the intermediate struct usage to ensure
that the assumptions utilised in runtime code hold true.

The primary assumptions are that the two `user_data` fields exist at the
same memory offset, and that the instantiated struct size can be
determined from the generic struct size and the length of the user data.

`net_buf_id` and `pool_get_uninit` must now use manual address
calculations as the `__bufs` type is no longer the actual size of the
instantiated variable.

Signed-off-by: default avatarJordan Yates <jordan.yates@data61.csiro.au>
parent 8d21e61d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment