pike.git/
src/
stralloc.c
Branch:
Tag:
Non-build tags
All tags
No tags
2015-11-14
2015-11-14 22:53:31 by Martin Nilsson <nilsson@fastmail.com>
0ddc5d8c22e9f9f75765c561407f3b9037501380 (
10
lines) (+
9
/-
1
)
[
Show
|
Annotate
]
Branch:
8.1
Fix some warnings. Added count of malloced strings.
2191:
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;
2207:
case STRING_ALLOC_SUBSTRING: num_substring ++; break;
+
case STRING_ALLOC_MALLOC:
+
num_malloc ++;
+
break;
} }
2216:
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) {
2231:
case STRING_ALLOC_MALLOC: size += PIKE_ALIGNTO(((s->len + 1) << s->size_shift), 4); break;
+
case STRING_ALLOC_STATIC:
+
break;
} return size;