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.37 1998/05/25 19:38:31 grubba Exp $"); + RCSID("$Id: stralloc.c,v 1.38 1998/09/18 21:33:07 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:256:    add_ref(s);       return s;   }      struct pike_string *debug_make_shared_string(const char *str)   {    return make_shared_binary_string(str, strlen(str));   }    + struct pike_string *make_shared_string2(const INT16 *str) + { +  INT32 e,len; +  struct pike_string *s; +  for(len=0;str[len];len++); +  s=begin_shared_string(len); +  for(e=0;e<len;e++) s->str[e]=str[e]; +  return end_shared_string(s); + } +    /*** Free strings ***/      void unlink_pike_string(struct pike_string *s)   {    int h;       h=StrHash(s->str,s->len);    propagate_shared_string(s,h);    base_table[h]=s->next;   #ifdef DEBUG