pike.git / src / stralloc.c

version» Context lines:

pike.git/src/stralloc.c:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: stralloc.c,v 1.165 2010/09/22 14:35:37 grubba Exp $ + || $Id: stralloc.c,v 1.166 2010/09/27 12:16:21 grubba Exp $   */      #include "global.h"   #include "stralloc.h"   #include "pike_macros.h"   #include "dynamic_buffer.h"   #include "pike_macros.h"   #include "pike_memory.h"   #include "pike_error.h"   #include "gc.h"
pike.git/src/stralloc.c:17:   #include "bignum.h"   #include "interpret.h"   #include "block_alloc.h"   #include "operators.h"      #include <errno.h>   #include <float.h>   #include <ctype.h>   #include <math.h>    - RCSID("$Id: stralloc.c,v 1.165 2010/09/22 14:35:37 grubba Exp $"); + RCSID("$Id: stralloc.c,v 1.166 2010/09/27 12:16:21 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:63:    mt_unlock(bucket_lock); \    } \   }while(0)      #define UNLOCK_BUCKET(HVAL) do { \    size_t hval__=(HVAL); \    mt_unlock(BUCKETLOCK(hval__)); \   }while(0)      #else - #define LOCK_BUCKET(HVAL) + #define LOCK_BUCKET(HVAL) CHECK_INTERPRETER_LOCK()   #define UNLOCK_BUCKET(HVAL)   #endif      #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_depth=0;
pike.git/src/stralloc.c:507: Inside #if defined(PIKE_RUN_UNLOCKED)
   /* Someone got here before us */    mt_lock(bucket_locks);    return;    }       /* Now that we have bucket zero, the hash table    * cannot change, go ahead and lock ALL buckets.    * NOTE: bucket zero is already locked    */    for(h=1;h<BUCKET_LOCKS;h++) mt_lock(bucket_locks+h); + #else +  CHECK_INTERPRETER_LOCK();   #endif       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);       need_more_hash_prefix_depth = 0;       for(h=0;h<old;h++)