question about how to use the ngx_radix_tree

Francois BERENGER francois.berenger at
Wed Oct 12 15:53:17 UTC 2016

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.

Should I compute this mask? How?

Thanks a lot,

More information about the nginx-devel mailing list