From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dmitry Vyal Subject: Re: How to free a ring? Date: Wed, 11 Sep 2013 13:07:35 +0400 Message-ID: <523032D7.4020004@gmail.com> References: <52301DA2.2060806@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: dev-VfR2kkLFssw@public.gmane.org To: AndyChen Return-path: In-Reply-To: List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" On 09/11/2013 11:46 AM, AndyChen wrote: > Dpdk hasn't API to free ring/memzone/mempool, what's the scene you > must free the ring? > Well, I'm writing a packet defragmenting code. I have a data structure consisting of a rte_hash, a rte_ring and an array allocated with rte_zmalloc. All these besides the ring can be freed. So looks like I can't destruct my object after allocating. Strictly speaking, I don't have to. The need shouldn't arise in normal situation. I just considered writing allocating/deallocating function pairs and processing all allocation errors to be a good practice. Isn't it a bit strange to have rte_hash_free() and not have rte_ring_free()? What's the reason for this? Best wishes, Dmitry