pike.git / src / rbtree.c

version» Context lines:

pike.git/src/rbtree.c:25:   #define rb_fatal \    (fprintf (stderr, "%s:%d: Fatal in rbtree: ", __FILE__, __LINE__), \    debug_rb_fatal)   DECLSPEC(noreturn) static void debug_custom_rb_fatal (    struct rb_node_hdr *tree, dump_data_fn *dump_data,    void *extra, const char *fmt, ...) ATTRIBUTE((noreturn, format (printf, 4, 5)));   #define custom_rb_fatal \    (fprintf (stderr, "%s:%d: Fatal in rbtree: ", __FILE__, __LINE__), \    debug_custom_rb_fatal)    + #else + #define rb_fatal Pike_fatal   #endif      void rbstack_low_push (struct rbstack_ptr *rbstack, struct rb_node_hdr *node)   {    struct rbstack_slice *new = ALLOC_STRUCT (rbstack_slice);    new->up = rbstack->slice;    new->stack[0] = node;   #ifdef RB_STATS    rbstack_slice_allocs++;    new->depth = rbstack->slice->depth;
pike.git/src/rbtree.c:255:    struct rb_node_hdr *parent, *grandparent, *uncle, *top;    RBSTACK_POP (rbstack, parent);   #ifdef PIKE_DEBUG    if (!parent) rb_fatal (node, "No parent on stack.\n");   #endif    RBSTACK_POP (rbstack, grandparent);    top = grandparent ? grandparent : parent;       while (parent->flags & RB_RED) {    /* Since the root always is black we know there's a grandparent. */ - #ifdef PIKE_DEBUG -  if (!grandparent) rb_fatal (parent, "No parent for red node.\n"); - #endif +  if (UNLIKELY(!grandparent)) rb_fatal (parent, "No parent for red node.\n");   #ifdef RB_STATS    rb_add_rebalance_cnt++;   #endif       if (parent == grandparent->prev) {    uncle = grandparent->next;       if (!(grandparent->flags & RB_THREAD_NEXT) && uncle->flags & RB_RED) {    /* Case 1:    * grandparent(B) *grandparent(R)