aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/paging.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2009-07-28 00:41:45 +0200
committerHarald Welte <laforge@gnumonks.org>2009-07-28 00:41:45 +0200
commit7bfc26749662e3a3227037cce4a24748343b50be (patch)
tree2bd0ad79d43b2e72407792d30cac97e5fb8f825d /openbsc/src/paging.c
parentb49248bf48b0856e3b156810681ea3fca44c728a (diff)
move allocation of talloc contexts into link-time constructor
This is much more optimal than checking if the context exists every time we allocate the respective object.
Diffstat (limited to 'openbsc/src/paging.c')
-rw-r--r--openbsc/src/paging.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/openbsc/src/paging.c b/openbsc/src/paging.c
index 0703e932f..b63a717b0 100644
--- a/openbsc/src/paging.c
+++ b/openbsc/src/paging.c
@@ -219,9 +219,6 @@ static void _paging_request(struct gsm_bts *bts, struct gsm_subscriber *subscr,
struct gsm_bts_paging_state *bts_entry = &bts->paging;
struct gsm_paging_request *req;
- if (!tall_paging_ctx)
- tall_paging_ctx = talloc_named_const(NULL, 1, "paging_request");
-
if (paging_pending_request(bts_entry, subscr)) {
DEBUGP(DPAG, "Paging request already pending\n");
return;
@@ -310,3 +307,8 @@ void paging_update_buffer_space(struct gsm_bts *bts, u_int16_t free_slots)
{
bts->paging.available_slots = free_slots;
}
+
+static __attribute__((constructor)) void on_dso_load_paging(void)
+{
+ tall_paging_ctx = talloc_named_const(NULL, 1, "paging_request");
+}