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.129 2001/07/03 23:55:06 hubbe Exp $"); + RCSID("$Id: stralloc.c,v 1.130 2001/08/15 11:52:23 hubbe Exp $");      #if PIKE_RUN_UNLOCKED   /* Make this bigger when we get lightweight threads */   #define BUCKET_LOCKS 2048   static PIKE_MUTEX_T *bucket_locks;      #define BUCKETLOCK(HVAL) \    (bucket_locks + ((hval__ % htable_size) & (BUCKET_LOCKS-1)))      #define LOCK_BUCKET(HVAL) do { \
pike.git/src/stralloc.c:481:      /* Allocate some fixed string sizes with BLOCK_ALLOC. */      /* Use the BLOCK_ALLOC() stuff for short strings */      #define SHORT_STRING_BLOCK 256   #define SHORT_STRING_THRESHOLD 15 /* % 4 === 1 */      struct short_pike_string0 {    PIKE_STRING_CONTENTS; -  p_wchar0 str[SHORT_STRING_THRESHOLD]; +  p_wchar0 str[SHORT_STRING_THRESHOLD+1];   };      struct short_pike_string1 {    PIKE_STRING_CONTENTS; -  p_wchar1 str[SHORT_STRING_THRESHOLD]; +  p_wchar1 str[SHORT_STRING_THRESHOLD+1];   };      struct short_pike_string2 {    PIKE_STRING_CONTENTS; -  p_wchar2 str[SHORT_STRING_THRESHOLD]; +  p_wchar2 str[SHORT_STRING_THRESHOLD+1];   };      BLOCK_ALLOC(short_pike_string0, SHORT_STRING_BLOCK)   BLOCK_ALLOC(short_pike_string1, SHORT_STRING_BLOCK)   BLOCK_ALLOC(short_pike_string2, SHORT_STRING_BLOCK)      #define really_free_short_pike_string(s) do { \    if (!s->size_shift) { \    really_free_short_pike_string0((struct short_pike_string0 *)s); \    } else if (s->size_shift == 1) { \