[dpdk-dev] [PATCH v3] hash table: add an iterator over conflicting entries

Michel Machado michel at digirati.com.br
Tue Sep 4 21:07:37 CEST 2018


Hi Yipeng,

On 09/04/2018 02:55 PM, Wang, Yipeng1 wrote:
> Do we need both of the state and istate struct? struct rte_hash_iterator_state  seems not doing much.
> How about we only have one "state" struct and just not expose the internals to the public API, similar to the
> rte_hash struct or rte_member_setsum struct.
> And in _init function use rte_malloc to allocate the state and add a _free function to free it.

    The purpose of have struct state is to enable applications to 
allocate iterator states on their execution stack or embedding iterator 
states in larger structs to avoid an extra malloc()/free().

    Do you foresee that the upcoming new underlying algorithm of hash 
tables will need to dynamically allocate iterator states?

[ ]'s
Michel Machado


More information about the dev mailing list