[dpdk-stable] [PATCH] malloc: fix size annotation for NUMA-aware realloc

David Marchand david.marchand at redhat.com
Fri Jun 11 11:19:06 CEST 2021


On Thu, Jun 10, 2021 at 2:19 PM Maxime Coquelin <mcoqueli at redhat.com> wrote:
> > __rte_alloc_size is mapped to compiler alloc_size attribute.
> >
> > Quoting gcc documentation:
> > """
> > alloc_size
> >     The alloc_size attribute is used to tell the compiler that the
> >     function return value points to memory, where the size is given by
> >     one or two of the functions parameters. GCC uses this information
> >     to improve the correctness of __builtin_object_size.
> >
> >     The function parameter(s) denoting the allocated size are specified
> >     by one or two integer arguments supplied to the attribute.
> >     The allocated size is either the value of the single function
> >     argument specified or the product of the two function arguments
> >     specified. Argument numbering starts at one.
> > """
> >
> > In rte_realloc_socket case, only 'size' matters.
> >
> > Note: this has been spotted by Maxime trying to use rte_realloc_socket
> > and compiling with gcc 11.
> >
> > Fixes: 17b347dab769 ("malloc: add alloc_size attribute to functions")
> > Cc: stable at dpdk.org
> >
> > Signed-off-by: David Marchand <david.marchand at redhat.com>
> Tested-by: Maxime Coquelin <maxime.coquelin at redhat.com>

Applied.


-- 
David Marchand



More information about the stable mailing list