pike.git / src / stralloc.c

version» Context lines:

pike.git/src/stralloc.c:20:      #include <errno.h>   #include <float.h>   #include <ctype.h>   #include <math.h>      #ifndef HUGE   #define HUGE HUGE_VAL   #endif /*!HUGE*/    - RCSID("$Id: stralloc.c,v 1.143 2002/08/15 14:49:25 marcus Exp $"); + RCSID("$Id: stralloc.c,v 1.144 2002/09/11 22:42:13 neotron Exp $");      /* #define STRALLOC_USE_PRIMES */      #ifdef STRALLOC_USE_PRIMES      #define SET_HSIZE(X) htable_size=hashprimes[(X)]   #define HMODULO(X) ((X) % htable_size)      #else   
pike.git/src/stralloc.c:83: Inside #if undefined(HASH_PREFIX)
  /* Experimental dynamic hash length */   #ifndef HASH_PREFIX   static unsigned int HASH_PREFIX=64;   static unsigned int need_more_hash_prefix=0;   #endif      unsigned INT32 htable_size=0;   static unsigned int hashprimes_entry=0;   static struct pike_string **base_table=0;   unsigned INT32 num_strings=0; - PMOD_EXPORT struct pike_string *empty_string = 0; + PMOD_EXPORT struct pike_string *empty_pike_string = 0;      /*** Main string hash function ***/      #define StrHash(s,len) low_do_hash(s,len,0)      static INLINE size_t low_do_hash(const void *s,    ptrdiff_t len__,    int size_shift)   {    size_t h;
pike.git/src/stralloc.c:1794:    SET_HSIZE(hashprimes_entry);    base_table=(struct pike_string **)xalloc(sizeof(struct pike_string *)*htable_size);    MEMSET((char *)base_table,0,sizeof(struct pike_string *)*htable_size);   #ifdef PIKE_RUN_UNLOCKED    {    int h;    bucket_locks=(PIKE_MUTEX_T *)xalloc(sizeof(PIKE_MUTEX_T)*BUCKET_LOCKS);    for(h=0;h<BUCKET_LOCKS;h++) mt_init(bucket_locks + h);    }   #endif -  empty_string = make_shared_string(""); +  empty_pike_string = make_shared_string("");   }      #ifdef DEBUG_MALLOC   struct shared_string_location *all_shared_string_locations;   #endif         void cleanup_shared_string_table(void)   {    unsigned INT32 e;    struct pike_string *s,*next;    -  if (empty_string) { -  free_string(empty_string); -  empty_string = 0; +  if (empty_pike_string) { +  free_string(empty_pike_string); +  empty_pike_string = 0;    }      #if defined(PIKE_DEBUG) && defined(DEBUG_MALLOC)    while(all_shared_string_locations)    {    struct shared_string_location *x=all_shared_string_locations;    all_shared_string_locations=x->next;    free_string(x->s);    x->s=0;    }