pike.git / src / stralloc.c

version» Context lines:

pike.git/src/stralloc.c:12:   #include "pike_memory.h"   #include "pike_error.h"   #include "gc.h"   #include "bignum.h"   #include "interpret.h"   #include "operators.h"   #include "pike_float.h"   #include "pike_types.h"   #include "block_allocator.h"   #include "whitespace.h" + #include "pike_search.h"      #include <errno.h>      #define SET_HSIZE(X) htable_mask=(htable_size=(X))-1   #define HMODULO(X) ((X) & (htable_mask))      static unsigned INT32 htable_mask;      #if (SIZEOF_LONG == 4) && defined(_LP64)   /* Kludge for gcc and the system header files not using the same model... */
pike.git/src/stralloc.c:389:      /* Find a string in the shared string table.    * This assumes that the string is minimized!!!!    */   static struct pike_string *internal_findstring(const char *s,    ptrdiff_t len,    enum size_shift size_shift,    size_t hval)   {    struct pike_string *curr; - //,**prev, **base; +     unsigned int depth=0;    unsigned int prefix_depth=0;       size_t h;    h=HMODULO(hval);    for(curr = base_table[h]; curr; curr = curr->next)    {   #ifdef PIKE_DEBUG    if(curr->refs<1)    {
pike.git/src/stralloc.c:1063: Inside #if defined(PIKE_DEBUG)
   Pike_fatal("Freeing shared string again, memory corrupt or other bug!\n");    }    if (s->size_shift > 2) {    Pike_fatal("Freeing string with bad shift (0x%08x); could it be a type?\n",    s->size_shift);    }   #endif    if (!(s->flags & STRING_NOT_SHARED))    unlink_pike_string(s);    if (s->flags & STRING_CLEAR_ON_EXIT) -  guaranteed_memset(s->str, 0, s->len<<s->size_shift); +  secure_zero(s->str, s->len<<s->size_shift);    free_unlinked_pike_string(s);    GC_FREE_SIMPLE_BLOCK(s);   }         void do_really_free_string(struct pike_string *s)   {    if (s)    really_free_string(s);   }