pike.git / src / rbtree.c

version» Context lines:

pike.git/src/rbtree.c:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: rbtree.c,v 1.13 2002/10/28 13:09:28 nilsson Exp $ + || $Id: rbtree.c,v 1.14 2002/12/05 20:13:04 mast Exp $   */      /* An implementation of a threaded red/black balanced binary tree.    *    * Created 2001-04-27 by Martin Stjernholm <mast@lysator.liu.se>    */      #include "global.h"    - RCSID("$Id: rbtree.c,v 1.13 2002/10/28 13:09:28 nilsson Exp $"); + RCSID("$Id: rbtree.c,v 1.14 2002/12/05 20:13:04 mast Exp $");      #include "interpret.h"   #include "pike_error.h"   #include "rbtree_low.h"      #include <assert.h>   #include <stdlib.h>      #if defined (PIKE_DEBUG) || defined (TEST_MULTISET)   
pike.git/src/rbtree.c:109: Inside #if defined(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;   }    + #if 0 + /* Disabled since these aren't tested and not currently used. */ +    void rbstack_assign (struct rbstack_ptr *target, struct rbstack_ptr *source)   { -  /* Not tested. */ -  +     struct rbstack_slice *src_slice = source->slice;    struct rbstack_slice *tgt_slice = target->slice;      #ifdef PIKE_DEBUG    if (target->ssp) Pike_fatal ("target rbstack not empty.\n");   #endif       target->ssp = source->ssp;    source->ssp = 0;   
pike.git/src/rbtree.c:147: Inside #if defined(RB_STATS)
   target->ssp * sizeof (struct rb_node_hdr *));   #ifdef RB_STATS    tgt_slice->maxdepth = src_slice->maxdepth;    tgt_slice->depth = src_slice->depth;   #endif    }   }      void rbstack_copy (struct rbstack_ptr *target, struct rbstack_ptr *source)   { -  /* Not tested. */ -  +     struct rbstack_slice *src_slice = source->slice;    struct rbstack_slice *tgt_stack_slice = target->slice;    size_t ssp = source->ssp;      #ifdef PIKE_DEBUG    if (target->ssp) Pike_fatal ("target rbstack not empty.\n");   #endif       target->ssp = ssp;   
pike.git/src/rbtree.c:188:    }       MEMCPY ((char *) &tgt_stack_slice->stack, (char *) &src_slice->stack,    ssp * sizeof (struct rb_node_hdr *));      #ifdef RB_STATS    target->slice->maxdepth = target->slice->depth = source->slice->depth;   #endif   }    + #endif /* Not tested or used. */ +    /* Offsets all the rb_node_hdr pointers in rbstack from their offsets    * relative oldbase to the same relative newbase. Useful if the memory    * block containing the tree has been moved. */   void rbstack_shift (struct rbstack_ptr rbstack,    struct rb_node_hdr *oldbase,    struct rb_node_hdr *newbase)   {    struct rb_node_hdr *node;    while ((node = RBSTACK_PEEK (rbstack))) {    rbstack.slice->stack[rbstack.ssp - 1] =