pike.git / src / stralloc.c

version» Context lines:

pike.git/src/stralloc.c:390: Inside #if defined(DEBUG)
  #endif    return tmp;   }      void dump_stralloc_strings(void)   {    unsigned INT32 e;    struct pike_string *p;    for(e=0;e<htable_size;e++)    for(p=base_table[e];p;p=p->next) -  printf("%ld refs \"%s\"\n",(long)p->refs,p->str); +  printf("0x%p: %ld refs \"%s\"\n",p,(long)p->refs,p->str);   }      #endif         /*** String compare functions ***/      /* does not take locale into account */   int low_quick_binary_strcmp(char *a,INT32 alen,    char *b,INT32 blen)
pike.git/src/stralloc.c:662: Inside #if defined(DEBUG) && defined(DEBUG_MALLOC)
   while(all_shared_string_locations)    {    struct shared_string_location *x=all_shared_string_locations;    all_shared_string_locations=x->next;    free_string(x->s);    x->s=0;    }       if(verbose_debug_exit)    { -  fprintf(stderr,"Leaked strings \n"); +  INT32 num,size; +  count_memory_in_strings(&num,&size); +  if(num) +  { +  fprintf(stderr,"Strings left: %d (%d bytes) (zapped)\n",num,size);    dump_stralloc_strings();    } -  +  }   #endif    for(e=0;e<htable_size;e++)    {    for(s=base_table[e];s;s=next)    {    next=s->next;   #ifdef REALLY_FREE    free((char *)s);   #else    s->next=0;