msgb ctx: use new msgb_talloc_ctx_init() in various main()s

Change-Id: I31d62d5e1f0b272985fdef5013270d385c4b988a
This commit is contained in:
Neels Hofmeyr 2016-09-16 01:56:37 +02:00
parent b058778df1
commit 21142f7898
7 changed files with 7 additions and 24 deletions

View File

@ -219,14 +219,12 @@ int bts_main(int argc, char **argv)
struct gsm_bts_role_bts *btsb;
struct gsm_bts_trx *trx;
struct e1inp_line *line;
void *tall_msgb_ctx;
int rc, i;
printf("((*))\n |\n / \\ OsmoBTS\n");
tall_bts_ctx = talloc_named_const(NULL, 1, "OsmoBTS context");
tall_msgb_ctx = talloc_pool(tall_bts_ctx, 100*1024);
msgb_set_talloc_ctx(tall_msgb_ctx);
msgb_talloc_ctx_init(tall_bts_ctx, 100*1024);
bts_log_init(NULL);

View File

@ -222,13 +222,11 @@ static int mgr_log_init(void)
int main(int argc, char **argv)
{
void *tall_msgb_ctx;
int rc;
tall_mgr_ctx = talloc_named_const(NULL, 1, "bts manager");
tall_msgb_ctx = talloc_named_const(tall_mgr_ctx, 1, "msgb");
msgb_set_talloc_ctx(tall_msgb_ctx);
msgb_talloc_ctx_init(tall_mgr_ctx);
mgr_log_init();

View File

@ -245,13 +245,11 @@ static int mgr_log_init(void)
int main(int argc, char **argv)
{
void *tall_msgb_ctx;
int rc;
tall_mgr_ctx = talloc_named_const(NULL, 1, "bts manager");
tall_msgb_ctx = talloc_named_const(tall_mgr_ctx, 1, "msgb");
msgb_set_talloc_ctx(tall_msgb_ctx);
msgb_talloc_ctx_init(tall_mgr_ctx, 0);
mgr_log_init();
if (classify_bts() != 0)

View File

@ -224,11 +224,8 @@ static void test_agch_queue_length_computation(void)
int main(int argc, char **argv)
{
void *tall_msgb_ctx;
tall_bts_ctx = talloc_named_const(NULL, 1, "OsmoBTS context");
tall_msgb_ctx = talloc_named_const(tall_bts_ctx, 1, "msgb");
msgb_set_talloc_ctx(tall_msgb_ctx);
msgb_talloc_ctx_init(tall_bts_ctx, 0);
bts_log_init(NULL);

View File

@ -66,11 +66,8 @@ static void test_cipher_parsing(void)
int main(int argc, char **argv)
{
void *tall_msgb_ctx;
tall_bts_ctx = talloc_named_const(NULL, 1, "OsmoBTS context");
tall_msgb_ctx = talloc_named_const(tall_bts_ctx, 1, "msgb");
msgb_set_talloc_ctx(tall_msgb_ctx);
msgb_talloc_ctx_init(tall_bts_ctx, 0);
bts_log_init(NULL);

View File

@ -58,7 +58,6 @@ int main(int argc, char **argv)
{
struct gsm_bts_role_bts *btsb;
void *tall_bts_ctx;
void *tall_msgb_ctx;
struct e1inp_line *line;
struct gsm_lchan *lchan;
struct osmo_phsap_prim nl1sap;
@ -67,8 +66,7 @@ int main(int argc, char **argv)
int i;
tall_bts_ctx = talloc_named_const(NULL, 1, "OsmoBTS context");
tall_msgb_ctx = talloc_named_const(tall_bts_ctx, 1, "msgb");
msgb_set_talloc_ctx(tall_msgb_ctx);
msgb_talloc_ctx_init(tall_bts_ctx, 0);
bts_log_init(NULL);
osmo_stderr_target->categories[DHO].loglevel = LOGL_DEBUG;

View File

@ -112,11 +112,8 @@ static void test_paging_sleep(void)
int main(int argc, char **argv)
{
void *tall_msgb_ctx;
tall_bts_ctx = talloc_named_const(NULL, 1, "OsmoBTS context");
tall_msgb_ctx = talloc_named_const(tall_bts_ctx, 1, "msgb");
msgb_set_talloc_ctx(tall_msgb_ctx);
msgb_talloc_ctx_init(tall_bts_ctx, 0);
bts_log_init(NULL);