From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v10 05/27] eal: introduce dtor macros Date: Tue, 10 Jul 2018 13:40:01 +0200 Message-ID: <2903699.tLnOVabUjO@xps> References: <42037d90036505fc764572b8a4c8b25a529c4ec7.1530791217.git.gaetan.rivet@6wind.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, shreyansh.jain@nxp.com To: Gaetan Rivet Return-path: Received: from wout1-smtp.messagingengine.com (wout1-smtp.messagingengine.com [64.147.123.24]) by dpdk.org (Postfix) with ESMTP id 341A27CEB for ; Tue, 10 Jul 2018 13:40:07 +0200 (CEST) In-Reply-To: <42037d90036505fc764572b8a4c8b25a529c4ec7.1530791217.git.gaetan.rivet@6wind.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 05/07/2018 13:48, Gaetan Rivet: > Signed-off-by: Gaetan Rivet 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?