Skip to contentSkip to conversation

How to free a ring?

DISCUSSION Dmitry Vyal 3 participants 4 messages Sep 11, 2013 2 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): CAHhF9PG+s4Kxgco8VsD+PNsT1SimuYTfkVyXcDhZPqbX1Ez1WA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#4 lore raw
Quoted 2 lines · AndyChen

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