[PATCH v6 17/17] eal: add function attributes for allocation functions

Ajit Khaparde ajit.khaparde at broadcom.com
Wed Oct 2 20:23:14 CEST 2024


On Wed, Oct 2, 2024 at 9:45 AM Wathsala Wathawana Vithanage
<wathsala.vithanage at arm.com> wrote:
>
>
>
> > -----Original Message-----
> > Subject: [PATCH v6 17/17] eal: add function attributes for allocation functions
> >
> > The allocation functions take a alignment argument that can be useful to hint
> > the compiler optimizer. This is supported by GCC and Clang but only useful with
> > GCC because Clang gives warning if alignment is 0.
> >
> > Newer versions of GCC have a malloc attribute that can be used to find
> > mismatches between allocation and free; the typical problem caught is a
> > pointer allocated with rte_malloc() that is then incorrectly freed using free().
> > The name of the DPDK wrapper macros for these attributes are chosen to be
> > similar to what GLIBC is using in cdefs.h.
> > Note: The rte_free function prototype was moved ahead of the allocation
> > functions since the dealloc attribute now refers to it.
> >
> > Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
> > Acked-by: Chengwen Feng <fengchengwen at huawei.com>
> > Acked-by: Anatoly Burakov <anatoly.burakov at intel.com>
>
> Acked-by: Wathsala Vithanage <wathsala.vithanage at arm.com>
Acked-by: Ajit Khaparde <ajit.khaparde at broadcom.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4218 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://mails.dpdk.org/archives/dev/attachments/20241002/c51b3d3d/attachment.bin>


More information about the dev mailing list