diff options
author | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2016-05-11 13:53:47 +0200 |
---|---|---|
committer | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2016-09-26 02:25:46 +0200 |
commit | c13e68774215c4156925e8a2012fcb9169cf70b2 (patch) | |
tree | 4c4dc2b3ece4dc558a19d8ae9236e6f59bfcf11e /openbsc/src/libcommon | |
parent | 77c8d5ffb52bd5da405fc869286b4f7aa7f88d4d (diff) |
mscsplit: talloc_ctx_init(): decouple from global tall_bsc_ctx
Decouple the talloc context allocations from global tall_bsc_ctx pointer.
It appears that talloc_ctx_init() was intended for general use, since it is
located in libcommon. It is currently used only by osmo-nitb; but the upcoming
osmo-cscn will use it as well.
Instead of defining in osmo-nitb main file, add definition in gsm_data.h.
Change-Id: I168106599b788f586be0ff0af4699b9746c1b103
Diffstat (limited to 'openbsc/src/libcommon')
-rw-r--r-- | openbsc/src/libcommon/talloc_ctx.c | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/openbsc/src/libcommon/talloc_ctx.c b/openbsc/src/libcommon/talloc_ctx.c index 528d3a2a7..a917a8c34 100644 --- a/openbsc/src/libcommon/talloc_ctx.c +++ b/openbsc/src/libcommon/talloc_ctx.c @@ -36,22 +36,21 @@ extern void *tall_map_ctx; extern void *tall_upq_ctx; extern void *tall_ctr_ctx; -void talloc_ctx_init(void) +void talloc_ctx_init(void *ctx_root) { - tall_msgb_ctx = talloc_named_const(tall_bsc_ctx, 0, "msgb"); - tall_fle_ctx = talloc_named_const(tall_bsc_ctx, 0, - "bs11_file_list_entry"); - tall_locop_ctx = talloc_named_const(tall_bsc_ctx, 0, "loc_updating_oper"); - tall_authciphop_ctx = talloc_named_const(tall_bsc_ctx, 0, "auth_ciph_oper"); - tall_gsms_ctx = talloc_named_const(tall_bsc_ctx, 0, "sms"); - tall_subscr_ctx = talloc_named_const(tall_bsc_ctx, 0, "subscriber"); - tall_sub_req_ctx = talloc_named_const(tall_bsc_ctx, 0, "subscr_request"); - tall_call_ctx = talloc_named_const(tall_bsc_ctx, 0, "gsm_call"); - tall_paging_ctx = talloc_named_const(tall_bsc_ctx, 0, "paging_request"); - 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_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_bsc_ctx, 0, "counter"); + tall_msgb_ctx = talloc_named_const(ctx_root, 0, "msgb"); + tall_fle_ctx = talloc_named_const(ctx_root, 0, "bs11_file_list_entry"); + tall_locop_ctx = talloc_named_const(ctx_root, 0, "loc_updating_oper"); + tall_authciphop_ctx = talloc_named_const(ctx_root, 0, "auth_ciph_oper"); + tall_gsms_ctx = talloc_named_const(ctx_root, 0, "sms"); + tall_subscr_ctx = talloc_named_const(ctx_root, 0, "subscriber"); + tall_sub_req_ctx = talloc_named_const(ctx_root, 0, "subscr_request"); + tall_call_ctx = talloc_named_const(ctx_root, 0, "gsm_call"); + tall_paging_ctx = talloc_named_const(ctx_root, 0, "paging_request"); + tall_sigh_ctx = talloc_named_const(ctx_root, 0, "signal_handler"); + tall_tqe_ctx = talloc_named_const(ctx_root, 0, "subch_txq_entry"); + tall_trans_ctx = talloc_named_const(ctx_root, 0, "transaction"); + tall_map_ctx = talloc_named_const(ctx_root, 0, "trau_map_entry"); + tall_upq_ctx = talloc_named_const(ctx_root, 0, "trau_upq_entry"); + tall_ctr_ctx = talloc_named_const(ctx_root, 0, "counter"); } |