pike.git / src / stralloc.c

version» Context lines:

pike.git/src/stralloc.c:519: Inside #if defined(REALLY_FREE)
  #ifdef REALLY_FREE    free((char *)s);   #else    s->next=0;   #endif    }    base_table[e]=0;    }    free((char *)base_table);   } +  + void count_memory_in_strings(INT32 *num, INT32 *size) + { +  unsigned INT32 e, num_=0, size_=0; +  if(!base_table) return; +  size_+=htable_size * sizeof(struct pike_string *); +  for(e=0;e<htable_size;e++) +  { +  struct pike_string *p; +  for(p=base_table[e];p;p=p->next) +  { +  num_++; +  size_+=sizeof(struct pike_string)+p->len; +  } +  } + #ifdef DEBUG +  if(num_strings != num_) +  fatal("Num strings is wrong!.\n"); + #endif +  num[0]=num_; +  size[0]=size_; + }