pike.git / src / stralloc.c

version» Context lines:

pike.git/src/stralloc.c:73:   }while(0)      #define UNLOCK_BUCKET(HVAL) do { \    size_t hval__=(HVAL); \    mt_unlock(BUCKETLOCK(hval__)); \   }while(0)      #else   #define LOCK_BUCKET(HVAL)   #define UNLOCK_BUCKET(HVAL) - #endif + #endif /* PIKE_RUN_UNLOCKED */      #define BEGIN_HASH_SIZE 997   #define MAX_AVG_LINK_LENGTH 2      /* Experimental dynamic hash length */   #ifndef HASH_PREFIX   static unsigned int HASH_PREFIX=64;   static unsigned int need_more_hash_prefix_depth=0;   #endif   
pike.git/src/stralloc.c:474:   static int wrong_hash(struct pike_string *s)   {    return s->hval != do_hash(s);   }   static int improper_zero_termination(struct pike_string *s)   {    return index_shared_string(s,s->len);   }   #else   #define locate_problem(X) - #endif + #endif /* PIKE_DEBUG */      /* Find a string in the shared string table.    * This assumes that the string is minimized!!!!    */   static INLINE struct pike_string *internal_findstring(const char *s,    ptrdiff_t len,    int size_shift,    size_t hval)   {    struct pike_string *curr,**prev, **base;
pike.git/src/stralloc.c:858: Inside #if undefined(HASH_PREFIX)
   h2=HMODULO(tmp2->hval);       tmp2->next=base_table[h2]; /* and re-hash */    base_table[h2]=tmp2;    }    }   #ifdef PIKE_RUN_UNLOCKED    for(h=0;h<BUCKET_LOCKS;h++) mt_unlock(bucket_locks + h);   #endif    } - #endif + #endif /* !HASH_PREFIX */   }      PMOD_EXPORT struct pike_string *debug_begin_wide_shared_string(size_t len, int shift)   {    struct pike_string *t = NULL;   #ifdef PIKE_DEBUG    extern int d_flag;    if(d_flag>10)    verify_shared_strings_tables();   #endif
pike.git/src/stralloc.c:1560: Inside #if defined(PIKE_DEBUG) and #if 0
   for(tmp2=base_table[e];tmp2;tmp2=tmp2->next)    {    if(tmp2 == tmp)    fprintf(stderr,"String found in hashbin %ld (not %ld)\n",    (long)e,    (long)HMODULO(foo->hval));    }    UNLOCK_BUCKET(e);    }    } - #endif + #endif /* 0 */    return tmp;   }      PMOD_EXPORT void debug_dump_pike_string(struct pike_string *s, INT32 max)   {    INT32 e;    fprintf(stderr,"0x%p: %ld refs, len=%ld, size_shift=%d, hval=%lux (%lx)\n",    s,    (long)s->refs,    DO_NOT_WARN((long)s->len),
pike.git/src/stralloc.c:1619: Inside #if defined(PIKE_DEBUG)
   for(p=base_table[e];p;p=p->next) {    debug_dump_pike_string(p, 70);   #ifdef DEBUG_MALLOC    debug_malloc_dump_references (p, 2, 1, 0);   #endif    }    UNLOCK_BUCKET(e);    }   }    - #endif + #endif /* PIKE_DEBUG */         /*** String compare functions ***/      /* does not take locale into account */   int low_quick_binary_strcmp(char *a, ptrdiff_t alen,    char *b, ptrdiff_t blen)   {    int tmp;    if(alen > blen)