Commit 18d56f08 authored by Niels Möller's avatar Niels Möller
Browse files

* src/xalloc.c (number_of_strings): Global variable to keep track

of the number of allocated strings.

Rev: src/xalloc.c:1.22
parent a73a3e21
......@@ -114,6 +114,8 @@ static void *xalloc(size_t size)
return res;
}
static unsigned number_of_strings = 0;
struct lsh_string *lsh_string_alloc(UINT32 length)
{
struct lsh_string *s
......@@ -123,6 +125,8 @@ struct lsh_string *lsh_string_alloc(UINT32 length)
#endif
s->length = length;
s->sequence_number = 0;
number_of_strings++;
return s;
}
......@@ -131,6 +135,10 @@ void lsh_string_free(struct lsh_string *s)
if (!s)
return;
assert(number_of_strings);
number_of_strings--;
#if 0
debug("lsh_string_free: freeing %xi,\n", (UINT32) s);
#endif
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment