pike.git / src / stralloc.c

version» Context lines:

pike.git/src/stralloc.c:653:    } \    } while(0)      /* note that begin_shared_string expects the _exact_ size of the string,    * not the maximum size    */   PMOD_EXPORT struct pike_string *debug_begin_shared_string(size_t len)   {    struct pike_string *t;   #ifdef PIKE_DEBUG -  extern int d_flag; +     if(d_flag>10)    verify_shared_strings_tables();   #endif    if (len <= SHORT_STRING_THRESHOLD)    {    t=ba_alloc(&string_allocator);    t->flags = STRING_NOT_HASHED | STRING_NOT_SHARED | STRING_IS_SHORT;    } else    {    t=xalloc(len + 1 + sizeof(struct pike_string_hdr));
pike.git/src/stralloc.c:763:    base_table[h2]=tmp2;    }    }    }   }      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    if ((len<<shift) <= SHORT_STRING_THRESHOLD) {   #ifdef PIKE_DEBUG    if (shift > 2)    Pike_fatal("Unsupported string shift: %d\n", shift);   #endif /* PIKE_DEBUG */    t=ba_alloc(&string_allocator);    t->flags = STRING_NOT_HASHED|STRING_NOT_SHARED|STRING_IS_SHORT;
pike.git/src/stralloc.c:1091:      PMOD_EXPORT void do_free_unlinked_pike_string(struct pike_string *s)   {    if (s)    free_unlinked_pike_string(s);   }      PMOD_EXPORT void really_free_string(struct pike_string *s)   {   #ifdef PIKE_DEBUG -  extern int d_flag; +     if (s->refs) {   #ifdef DEBUG_MALLOC    describe_something(s, T_STRING, 0,2,0, NULL);   #endif    Pike_fatal("Freeing string with %d references.\n", s->refs);    }    if(d_flag > 2 && !(s->flags & STRING_NOT_SHARED))    {    if(s->next == (struct pike_string *)(ptrdiff_t)-1)    Pike_fatal("Freeing shared string again!\n");