On 9/30/2024 8:44 PM, Stephen Hemminger wrote:
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.

Recent 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().

Signed-off-by: Stephen Hemminger <step...@networkplumber.org>
Acked-by: Chengwen Feng <fengcheng...@huawei.com>
---

<snip>

+
+/**
+ * Frees the memory space pointed to by the provided pointer.
+ *
+ * This pointer must have been returned by a previous call to
+ * rte_malloc(), rte_zmalloc(), rte_calloc() or rte_realloc(). The behaviour of
+ * rte_free() is undefined if the pointer does not match this requirement.
+ *
+ * If the pointer is NULL, the function does nothing.
+ *
+ * @param ptr
+ *   The pointer to memory to be freed.
+ */
+void
+rte_free(void *ptr);
+

Is there any particular reason why rte_free was moved?

Otherwise,

Acked-by: Anatoly Burakov <anatoly.bura...@intel.com>


--
Thanks,
Anatoly

Reply via email to