Skip to content
Commit b70f92e5 authored by Johann Fischer's avatar Johann Fischer Committed by Carles Cufí
Browse files

net: buf: keep memory alignment provided by k_heap_alloc and k_malloc



Allocation callback in net_buf_heap_cb and net_buf_var_cb
used for net_bufs with variable size payloads, defined by
NET_BUF_POOL_HEAP_DEFINE or NET_BUF_POOL_VAR_DEFINE,
allocate one more octet for internal variable ref_count,
used in function generic_data_ref(), which in turn is needed
for net_buf_clone()).
The user gets a buffer which is shifted by one octet in memory
block. This breaks alignment provided k_heap_alloc and k_malloc.

Signed-off-by: default avatarJohann Fischer <johann.fischer@nordicsemi.no>
parent ba966e71
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment