pike.git / src / stralloc.c

version» Context lines:

pike.git/src/stralloc.c:8:   #include "pike_macros.h"   #include "dynamic_buffer.h"   #include "pike_macros.h"   #include "pike_memory.h"   #include "error.h"   #include "gc.h"   #include "stuff.h"      #include <ctype.h>    - RCSID("$Id: stralloc.c,v 1.30 1998/03/28 15:11:13 grubba Exp $"); + RCSID("$Id: stralloc.c,v 1.31 1998/04/17 05:13:32 hubbe Exp $");      #define BEGIN_HASH_SIZE 997   #define MAX_AVG_LINK_LENGTH 3   #define HASH_PREFIX 64      unsigned INT32 htable_size=0;   static unsigned int hashprimes_entry=0;   static struct pike_string **base_table=0;   static unsigned INT32 full_hash_value;   unsigned INT32 num_strings=0;
pike.git/src/stralloc.c:365: Inside #if defined(DEBUG)
      if(s->str[s->len])    {    locate_problem(improper_zero_termination);    fatal("Shared string is not zero terminated properly.\n");    }   }      void verify_shared_strings_tables(void)   { -  unsigned INT32 e, h; +  unsigned INT32 e, h, num=0;    struct pike_string *s;       for(e=0;e<htable_size;e++)    {    h=0;    for(s=base_table[e];s;s=s->next)    { -  +  num++;    h++;    if(s->len < 0)    fatal("Shared string shorter than zero bytes.\n");       if(s->refs <= 0)    {    locate_problem(has_zero_refs);    fatal("Shared string had too few references.\n");    }   
pike.git/src/stralloc.c:408: Inside #if defined(DEBUG)
   if(h>10000)    {    struct pike_string *s2;    for(s2=s;s2;s2=s2->next)    if(s2 == s)    fatal("Shared string table is cyclic.\n");    h=0;    }    }    } +  if(num != num_strings) +  fatal("Num strings is wrong %d!=%d\n",num,num_strings);   }      int safe_debug_findstring(struct pike_string *foo)   {    unsigned INT32 e;    if(!base_table) return 0;    for(e=0;e<htable_size;e++)    {    struct pike_string *p;    for(p=base_table[e];p;p=p->next)
pike.git/src/stralloc.c:828:    {    struct pike_string *p;    for(p=base_table[e];p;p=p->next)    {    num_++;    size_+=sizeof(struct pike_string)+p->len;    }    }   #ifdef DEBUG    if(num_strings != num_) -  fatal("Num strings is wrong!.\n"); +  fatal("Num strings is wrong! %d!=%d.\n",num_strings, num_);   #endif    num[0]=num_;    size[0]=size_;   }      void gc_mark_all_strings(void)   {    unsigned INT32 e;    if(!base_table) return;    for(e=0;e<htable_size;e++)    {    struct pike_string *p;    for(p=base_table[e];p;p=p->next) gc_is_referenced(p);    }   }