counter: create their own talloc context for better readability

This commit is contained in:
Harald Welte 2009-12-24 10:04:09 +01:00
parent 30d2ebddd6
commit 026a6c3389
2 changed files with 5 additions and 1 deletions

View File

@ -33,9 +33,11 @@
static LLIST_HEAD(counters);
void *tall_ctr_ctx;
struct counter *counter_alloc(const char *name)
{
struct counter *ctr = talloc_zero(tall_bsc_ctx, struct counter);
struct counter *ctr = talloc_zero(tall_ctr_ctx, struct counter);
if (!ctr)
return NULL;

View File

@ -14,6 +14,7 @@ extern void *tall_tqe_ctx;
extern void *tall_trans_ctx;
extern void *tall_map_ctx;
extern void *tall_upq_ctx;
extern void *tall_ctr_ctx;
void talloc_ctx_init(void)
{
@ -31,4 +32,5 @@ void talloc_ctx_init(void)
tall_trans_ctx = talloc_named_const(tall_bsc_ctx, 0, "transaction");
tall_map_ctx = talloc_named_const(tall_bsc_ctx, 0, "trau_map_entry");
tall_upq_ctx = talloc_named_const(tall_bsc_ctx, 0, "trau_upq_entry");
tall_ctr_ctx = talloc_named_const(tall_ctr_ctx, 0, "counter");
}