[dpdk-dev] [PATCH] mempool: rename functions with confusing names

Bruce Richardson bruce.richardson at intel.com
Wed Jun 29 18:00:22 CEST 2016


On Wed, Jun 29, 2016 at 05:55:27PM +0200, Thomas Monjalon wrote:
> 2016-06-29 14:55, Bruce Richardson:
> > The mempool_count and mempool_free_count behaved contrary to what their
> > names suggested. The free_count function actually returned the number of
> > elements that were allocated from the pool, not the number unallocated as
> > the name implied.
> > 
> > Fix this by introducing two new functions to replace the old ones,
> > * rte_mempool_unallocated_count to replace rte_mempool_count
> > * rte_mempool_allocated_count to replace rte_mempool_free_count
> 
> What about available/used instead of unallocated/allocated?
> 

I don't particularly mind what the name is, to be honest. I like "avail"
because it is shorter, but I'm a little uncertain about "used", because it
implies that the entries are finished with i.e. like a used match, or tissue :-)

How about "avail/in_use"?

/Bruce


More information about the dev mailing list