pike.git / src / stralloc.c

version» Context lines:

pike.git/src/stralloc.c:19:      #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.114 2001/01/10 11:26:44 hubbe Exp $"); + RCSID("$Id: stralloc.c,v 1.115 2001/02/02 20:36:22 mast Exp $");      #define BEGIN_HASH_SIZE 997   #define MAX_AVG_LINK_LENGTH 3      /* Experimental dynamic hash length */   #ifndef HASH_PREFIX   static unsigned int HASH_PREFIX=64;   static unsigned int need_more_hash_prefix=0;   #endif   
pike.git/src/stralloc.c:1763:   }      PMOD_EXPORT void init_string_builder(struct string_builder *s, int mag)   {    s->malloced=256;    s->s=begin_wide_shared_string(256,mag);    s->s->len=0;    s->known_shift=0;   }    + PMOD_EXPORT void init_string_builder_alloc(struct string_builder *s, ptrdiff_t length, int mag) + { +  s->malloced=length; +  s->s=begin_wide_shared_string(length,mag); +  s->s->len=0; +  s->known_shift=0; + } +    static void string_build_mkspace(struct string_builder *s,    ptrdiff_t chars, int mag)   {    if(mag > s->s->size_shift)    {    struct pike_string *n;    ptrdiff_t l = s->s->len + chars + s->malloced;    n=begin_wide_shared_string(l,mag);    pike_string_cpy(MKPCHARP_STR(n),s->s);    n->len=s->s->len;