pike.git / src / las.c

version» Context lines:

pike.git/src/las.c:1:   /*\   ||| This file a part of Pike, and is copyright by Fredrik Hubinette   ||| Pike is distributed as GPL (General Public License)   ||| See the files COPYING and DISCLAIMER for more information.   \*/   /**/   #include "global.h" - RCSID("$Id: las.c,v 1.217 2000/09/28 16:26:01 grubba Exp $"); + RCSID("$Id: las.c,v 1.218 2000/09/30 19:19:48 grubba Exp $");      #include "language.h"   #include "interpret.h"   #include "las.h"   #include "array.h"   #include "object.h"   #include "stralloc.h"   #include "dynamic_buffer.h"   #include "lex.h"   #include "pike_types.h"
pike.git/src/las.c:365: Inside #if defined(SHARED_NODES)
  static size_t hash_node(node *n)   {    return hashmem((unsigned char *)&(n->token),    sizeof(node) - OFFSETOF(node_s, token), sizeof(node));   }      static void add_node(node *n)   {    size_t hval = n->hash % node_hash.size;    + #ifdef PIKE_DEBUG +  node *probe = node_hash.table[hval]; +  while(probe) { +  if (probe == n) { +  fatal("add_node(%p): Node already added!\n"); +  } +  probe = probe->next; +  } + #endif /* PIKE_DEBUG */    n->next = node_hash.table[hval];    node_hash.table[hval] = n;   }      static void sub_node(node *n)   {    node *prior;       if (!node_hash.size) {    return;
pike.git/src/las.c:393: Inside #if defined(SHARED_NODES)
   node_hash.table[n->hash % node_hash.size] = n->next;    } else {    while(prior && (prior->next != n)) {    prior = prior->next;    }    if (!prior) {    return;    }    prior->next = n->next;    } +  n->next = NULL;   }      static node *freeze_node(node *orig)   {    size_t hash = hash_node(orig);    node *n;       /* free_node() wants a correct hash */    orig->hash = hash;