From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id B51974C71 for ; Tue, 20 Mar 2018 10:40:58 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Mar 2018 02:40:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,334,1517904000"; d="scan'208";a="209742958" Received: from unknown (HELO [10.237.220.112]) ([10.237.220.112]) by orsmga005.jf.intel.com with ESMTP; 20 Mar 2018 02:40:54 -0700 To: Olivier Matz Cc: dev@dpdk.org, keith.wiles@intel.com, jianfeng.tan@intel.com, andras.kovacs@ericsson.com, laszlo.vadkeri@ericsson.com, benjamin.walker@intel.com, bruce.richardson@intel.com, thomas@monjalon.net, konstantin.ananyev@intel.com, kuralamudhan.ramakrishnan@intel.com, louise.m.daly@intel.com, nelio.laranjeiro@6wind.com, yskoh@mellanox.com, pepperjo@japf.ch, jerin.jacob@caviumnetworks.com, hemant.agrawal@nxp.com References: <757ab0a9ebe0e921c2ab77562cb0333da8334c50.1520083504.git.anatoly.burakov@intel.com> <20180319173457.cbxyj2pummor2g5i@platinum> From: "Burakov, Anatoly" Message-ID: <6f08a72d-c973-70a0-35ad-86b536563a8e@intel.com> Date: Tue, 20 Mar 2018 09:40:53 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180319173457.cbxyj2pummor2g5i@platinum> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH 08/41] eal: make malloc free return resulting malloc element X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Mar 2018 09:40:59 -0000 On 19-Mar-18 5:34 PM, Olivier Matz wrote: > On Sat, Mar 03, 2018 at 01:45:56PM +0000, Anatoly Burakov wrote: >> Signed-off-by: Anatoly Burakov >> --- >> lib/librte_eal/common/malloc_elem.c | 4 ++-- >> lib/librte_eal/common/malloc_elem.h | 2 +- >> lib/librte_eal/common/malloc_heap.c | 4 ++-- >> 3 files changed, 5 insertions(+), 5 deletions(-) >> >> diff --git a/lib/librte_eal/common/malloc_elem.c b/lib/librte_eal/common/malloc_elem.c >> index 008f5a3..c18f050 100644 >> --- a/lib/librte_eal/common/malloc_elem.c >> +++ b/lib/librte_eal/common/malloc_elem.c >> @@ -379,7 +379,7 @@ malloc_elem_join_adjacent_free(struct malloc_elem *elem) >> * blocks either immediately before or immediately after newly freed block >> * are also free, the blocks are merged together. >> */ >> -int >> +struct malloc_elem * >> malloc_elem_free(struct malloc_elem *elem) >> { >> void *ptr; >> @@ -397,7 +397,7 @@ malloc_elem_free(struct malloc_elem *elem) >> >> memset(ptr, 0, data_len); >> >> - return 0; >> + return elem; >> } >> >> /* > > An explanation about why this change is needed would make sense I think. > > Thanks, > Olivier > Sure, i'll add this in future commits. However, to provide some context - we need this because down the line we will need to know which element did we create/free to be able to roll back the changes, should the sync fail. -- Thanks, Anatoly