From cc6240aeb2e895a8df8c4bdca7fcae082b4f00bb Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Tue, 13 Feb 2018 21:21:42 +0100 Subject: libcommon: eliminate talloc_ctx.c Interestingly enough, talloc_ctx_init() actually had not a single caller. While dropping it, see to it that the few contexts that are actually used in osmo-bsc.git are indeed initialized in all the main scopes. Also initialize two void* ctxts as NULL explicitly, to allocate under the NULL context in case some main scope forgets to branch it off another root context. (That's bsc, fle and paging, all others actually come in from other libraries.) Change-Id: I344a3d07e146999e154824837ed95db2b9879356 --- src/osmo-bsc/osmo_bsc_main.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/osmo-bsc/osmo_bsc_main.c') diff --git a/src/osmo-bsc/osmo_bsc_main.c b/src/osmo-bsc/osmo_bsc_main.c index a6ea56c07..424d8169b 100644 --- a/src/osmo-bsc/osmo_bsc_main.c +++ b/src/osmo-bsc/osmo_bsc_main.c @@ -464,6 +464,12 @@ const struct log_info log_info = { .num_cat = ARRAY_SIZE(osmo_bsc_categories), }; +extern void *tall_paging_ctx; +extern void *tall_fle_ctx; +extern void *tall_sigh_ctx; +extern void *tall_tqe_ctx; +extern void *tall_ctr_ctx; + int main(int argc, char **argv) { struct bsc_msc_data *msc; @@ -474,6 +480,12 @@ int main(int argc, char **argv) msgb_talloc_ctx_init(tall_bsc_ctx, 0); vty_info.tall_ctx = tall_bsc_ctx; + tall_paging_ctx = talloc_named_const(tall_bsc_ctx, 0, "paging_request"); + tall_fle_ctx = talloc_named_const(tall_bsc_ctx, 0, "bs11_file_list_entry"); + tall_sigh_ctx = talloc_named_const(tall_bsc_ctx, 0, "signal_handler"); + tall_tqe_ctx = talloc_named_const(tall_bsc_ctx, 0, "subch_txq_entry"); + tall_ctr_ctx = talloc_named_const(tall_bsc_ctx, 0, "counter"); + osmo_init_logging(&log_info); osmo_stats_init(tall_bsc_ctx); -- cgit v1.2.3