[dpdk-dev] [PATCH v10 05/27] eal: introduce dtor macros

Thomas Monjalon thomas at monjalon.net
Tue Jul 10 13:40:01 CEST 2018


05/07/2018 13:48, Gaetan Rivet:
> Signed-off-by: Gaetan Rivet <gaetan.rivet at 6wind.com>

Please justify why you need destructors, by providing a commit log.

> --- a/lib/librte_eal/common/include/rte_common.h
> +++ b/lib/librte_eal/common/include/rte_common.h
> @@ -111,6 +111,29 @@ static void __attribute__((constructor(RTE_PRIO(prio)), used)) func(void)
>  #define RTE_INIT(func) \
>  	RTE_INIT_PRIO(func, LAST)
>  
> +/**
> + * Run after main() with low priority.
> + *
> + * @param func
> + *   Destructor function name.
> + * @param prio
> + *   Priority number must be above 100.
> + *   Lowest number is the last to run.
> + */
> +#define RTE_FINI_PRIO(func, prio) \
> +static void __attribute__((destructor(RTE_PRIO(prio)), used)) func(void)

I don't like the name of this macro.
What about RTE_CLEAN_PRIO?




More information about the dev mailing list