> From: Bruce Richardson [mailto:[email protected]]
> Sent: Tuesday, 1 December 2026 19.23
> 
> Many drivers allocate small control-path messages, which consist of a
> header structure followed by a variable-length array, using malloc and
> free, which adds error handling and the risk of leaks on error paths.
> 
> Add RTE_DEFINE_FLEX and RTE_DEFINE_FLEX_BYTES macros to define such
> buffers on the stack instead, (similar to equivalent macros in Linux
> kernel). The buffer is a union of a byte array and the structure type,
> giving correct alignment and type-safe access via a pointer, with the
> byte array first so that zero-initialization covers the whole buffer.
> 
> Signed-off-by: Bruce Richardson <[email protected]>
> ---

I thought we wanted to get rid of variable length arrays...
Could this be implemented using alloca() instead?


Reply via email to