pike.git / src / rbtree.c

version» Context lines:

pike.git/src/rbtree.c:28:    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)      #endif    - void rbstack_push (struct rbstack_ptr *rbstack, struct rb_node_hdr *node) + 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;    new->maxdepth = rbstack->slice->maxdepth;   #endif    rbstack->slice = new;    rbstack->ssp = 1;   }    - void rbstack_pop (struct rbstack_ptr *rbstack) + void rbstack_low_pop (struct rbstack_ptr *rbstack)   {    struct rbstack_slice *old = rbstack->slice;    rbstack->slice = old->up;   #ifdef RB_STATS    rbstack->slice->maxdepth = old->maxdepth;   #endif    xfree (old);    rbstack->ssp = STACK_SLICE_SIZE;   }    - void rbstack_up (struct rbstack_ptr *rbstack) + void rbstack_low_up (struct rbstack_ptr *rbstack)   {    rbstack->slice = rbstack->slice->up;    rbstack->ssp = STACK_SLICE_SIZE;   }    - void rbstack_up_to_root (struct rbstack_ptr *rbstack) + void rbstack_low_up_to_root (struct rbstack_ptr *rbstack)   {    struct rbstack_slice *up;    while ((up = rbstack->slice->up)) rbstack->slice = up;    rbstack->ssp = 0;   }    - void rbstack_free (struct rbstack_ptr *rbstack) + void rbstack_low_free (struct rbstack_ptr *rbstack)   {    struct rbstack_slice *ptr = rbstack->slice;    do {    struct rbstack_slice *old = ptr;    ptr = ptr->up;   #ifdef RB_STATS    ptr->maxdepth = old->maxdepth;   #endif    xfree (old);    } while (ptr->up);
pike.git/src/rbtree.c:94:    struct rb_node_hdr *node)   {    struct rbstack_ptr rbp1 = *top, rbp2 = *top, rbpos = *pos;    RBSTACK_PUSH (rbp2, NULL);    *top = rbp2;       while (rbp1.ssp != rbpos.ssp || rbp1.slice != rbpos.slice) {    rbp2.slice->stack[--rbp2.ssp] = rbp1.slice->stack[--rbp1.ssp];    if (!rbp2.ssp) rbp2.slice = rbp1.slice, rbp2.ssp = STACK_SLICE_SIZE;    if (!rbp1.ssp) { -  if (rbp1.slice->up) rbstack_up (&rbp1); +  if (rbp1.slice->up) rbstack_low_up (&rbp1);   #ifdef PIKE_DEBUG    else if (rbp1.ssp != rbpos.ssp || rbp1.slice != rbpos.slice)    Pike_fatal ("Didn't find the given position on the stack.\n");   #endif    }    }       RBSTACK_POKE (rbp2, node);    *pos = rbp2;   }