pike.git / src / stralloc.c

version» Context lines:

pike.git/src/stralloc.c:2184:    base_table=0;    num_strings=0;      #ifdef DO_PIKE_CLEANUP    ba_destroy(&string_allocator);   #endif /* DO_PIKE_CLEANUP */   }      void count_string_types() {    unsigned INT32 e; -  size_t num_static = 0, num_short = 0, num_substring = 0; +  size_t num_static = 0, num_short = 0, num_substring = 0, num_malloc = 0;       for (e = 0; e < htable_size; e++) {    struct pike_string * s;       for (s = base_table[e]; s; s = s->next)    switch (s->alloc_type) {    case STRING_ALLOC_BA:    num_short ++;    break;    case STRING_ALLOC_STATIC:    num_static ++;    break;    case STRING_ALLOC_SUBSTRING:    num_substring ++;    break; -  +  case STRING_ALLOC_MALLOC: +  num_malloc ++; +  break;    }    }       push_static_text("num_short_strings");    push_ulongest(num_short);    push_static_text("num_static_strings");    push_ulongest(num_static);    push_static_text("num_substrings");    push_ulongest(num_substring); -  +  push_static_text("num_malloced_strings"); +  push_ulongest(num_malloc);   }      size_t count_memory_in_string(const struct pike_string * s) {    size_t size = sizeof(struct pike_string);       switch (s->alloc_type) {    case STRING_ALLOC_SUBSTRING:    size += sizeof( struct pike_string *);    break;    case STRING_ALLOC_BA:    size += sizeof(struct pike_string);    break;    case STRING_ALLOC_MALLOC:    size += PIKE_ALIGNTO(((s->len + 1) << s->size_shift), 4);    break; -  +  case STRING_ALLOC_STATIC: +  break;    }       return size;   }      void count_memory_in_strings(size_t *num, size_t *_size)   {    unsigned INT32 e;    size_t size = 0;    *num = num_strings;