path: root/src/gsm
diff options
authorHarald Welte <laforge@gnumonks.org>2019-03-20 11:39:40 +0100
committerHarald Welte <laforge@gnumonks.org>2019-07-31 11:50:27 +0200
commit6079675bdb652045eff48880b0d9938b3e7e79ad (patch)
treeaf0651e53b2cd9023ee69ea5f29cdf6603bac1e7 /src/gsm
parent7b4a05d535f0ecc070e9b506ad0a667e24b67f71 (diff)
make use of OTC_GLOBAL when allocating library-internal contextslaforge/context
As libosmcore is now managing the global talloc contexts, there's no point in having APIs where the user tells the library about which talloc contexts to use for a given sub-system. Change-Id: I48f475efd3ee0d5120b8fc30861e852d1a6920b1
Diffstat (limited to 'src/gsm')
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gsm/lapd_core.c b/src/gsm/lapd_core.c
index a0f3c2b4..5d406b8d 100644
--- a/src/gsm/lapd_core.c
+++ b/src/gsm/lapd_core.c
@@ -253,7 +253,7 @@ static void lapd_dl_newstate(struct lapd_datalink *dl, uint32_t state)
dl->state = state;
-static void *tall_lapd_ctx = NULL;
+static __thread void *tall_lapd_ctx;
/* init datalink instance and allocate history */
void lapd_dl_init(struct lapd_datalink *dl, uint8_t k, uint8_t v_range,
@@ -300,7 +300,7 @@ void lapd_dl_init(struct lapd_datalink *dl, uint8_t k, uint8_t v_range,
lapd_dl_newstate(dl, LAPD_STATE_IDLE);
if (!tall_lapd_ctx)
- tall_lapd_ctx = talloc_named_const(NULL, 1, "lapd context");
+ tall_lapd_ctx = talloc_named_const(OTC_GLOBAL, 1, "lapd context");
dl->tx_hist = talloc_zero_array(tall_lapd_ctx,
struct lapd_history, dl->range_hist);