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.134 2001/09/06 08:07:10 hubbe Exp $"); + RCSID("$Id: stralloc.c,v 1.135 2001/09/21 21:53:19 grubba 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:1960:    really_free_pike_string(s->s);    s->malloced=l;    s->s=n;    }    else if(((size_t)s->s->len+chars) > ((size_t)s->malloced))    {    size_t newlen = MAXIMUM((size_t)(s->malloced*2),    (size_t)(s->s->len + chars));    ptrdiff_t oldlen = s->s->len;    +  s->s->len = s->malloced; /* Restore the real length */    s->s = realloc_unlinked_string(s->s, newlen);    s->s->len = oldlen;    s->malloced = newlen;    }   }      PMOD_EXPORT void *string_builder_allocate(struct string_builder *s, ptrdiff_t chars, int mag)   {    void *ret;    string_build_mkspace(s, chars, mag);