[PATCH v12 1/6] memarea: introduce memarea library

Morten Brørup mb at smartsharesystems.com
Sun Jan 15 08:58:15 CET 2023


> From: Chengwen Feng [mailto:fengchengwen at huawei.com]
> Sent: Saturday, 14 January 2023 12.50
> 
> The memarea library is an allocator of variable-size object which based
> on a memory region.
> 
> This patch provides rte_memarea_create() and rte_memarea_destroy() API.
> 
> Signed-off-by: Chengwen Feng <fengchengwen at huawei.com>
> Reviewed-by: Dongdong Liu <liudongdong3 at huawei.com>
> ---

[...]

> +struct memarea_obj {
> +	TAILQ_ENTRY(memarea_obj) obj_node;
> +	TAILQ_ENTRY(memarea_obj) free_node;
> +	size_t                   size;
> +	size_t                   alloc_size;
> +	uint32_t                 magic;
> +};

The magic cookie is for debug purposes only, and should be enclosed by #ifdef RTE_LIBRTE_MEMAREA_DEBUG, like in the mempool library [1].

[1]: https://elixir.bootlin.com/dpdk/latest/source/lib/mempool/rte_mempool.h#L154

With that added:

Series-acked-by: Morten Brørup <mb at smartsharesystems.com>



More information about the dev mailing list