question about how to use the ngx_radix_tree

Francois BERENGER francois.berenger at inria.fr
Thu Oct 13 09:20:24 UTC 2016


On 10/12/2016 05:53 PM, Francois BERENGER wrote:
> Dear list,
> 
> I am interested in using this data structure.
> 
> Would it be possible to have a few usage examples of it?
> I looked in the nginx code via github but found only
> few usages and not very informative about how to use it properly.
> 
> I am interested in those functions:
> ngx_radix_tree_t *ngx_radix_tree_create(ngx_int_t preallocate);
> 
> ngx_int_t ngx_radix32tree_insert(ngx_radix_tree_t *tree,
>                                  uint32_t key, uint32_t mask,
> 	                         uintptr_t value);
> ngx_int_t ngx_radix32tree_delete(ngx_radix_tree_t *tree,
>                                  uint32_t key, uint32_t mask);
> uintptr_t ngx_radix32tree_find(ngx_radix_tree_t *tree, uint32_t key);
> 
> Especially, in insert and delete I don't know what should be the value
> of the mask parameter.

All ones seems fine in my tests.
Sorry for the noise.

> Should I compute this mask? How?
> 
> Thanks a lot,
> Francois.
> 
> _______________________________________________
> nginx-devel mailing list
> nginx-devel at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx-devel
> 

-- 
Regards,
Francois.
"When in doubt, use more types"



More information about the nginx-devel mailing list