<div dir="ltr">Hi.<div><br></div><div>As shown the subject, I wonder how to check some node has been deleted from the red-black tree?</div><div><br></div><div>The case is like the following:</div><div><br></div><div>Step 1:</div><div>node1 = ngx_rbtree_insert(...);</div><div>node2 = <span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">ngx_rbtree_insert(...);</span></div><div><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">node3 = ngx_rbtree_insert(...);</span><br></span></div><div><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></span></div><div><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">Step 2:</span></span></div><div><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">node = find_node_from_rbtree(...);</span></span></div><div>remove_expired_node(...); /* maybe include the node just found. */</div><div>new_node = malloc(...);</div><div>if (new_node == NULL) {</div><div>      return;</div><div>}</div><div>/* We should keep the found node alive until the new node is succefully allocated */</div><div>if (is_in_rbtree(node)) {  /* I wonder how to check */</div><div>    ngx_rbtree_delete(...);</div><div>}</div><div>ngx_rbtree_insert(new_node);</div><div><br></div><div>Or have other suggestions?</div><div><br></div><div>Thanks.</div><div>B.R.</div></div>