From b6acfdaa24851e1aa95bfc4611709737aaafa5f1 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Thu, 17 Oct 2013 19:41:11 +0200 Subject: bts: Introduce a singleton for the BTS and use it in the code Compared to the previous code there will be a branch to get the global pointer so the code will be slightly slower than the previous version but it allows us to start creating objects but still use the code from C. It is best approach I have found so far. One downside of C++ is that by default talloc will not be used (unless we override the new operator to use talloc. Right now we need to memset the C data structure by hand. The benefit of enforcing a better structure should is more important though. --- tests/alloc/AllocTest.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'tests/alloc') diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp index 3d58f509..3b75763a 100644 --- a/tests/alloc/AllocTest.cpp +++ b/tests/alloc/AllocTest.cpp @@ -33,7 +33,6 @@ extern "C" { /* globals used by the code */ void *tall_pcu_ctx; -struct gprs_rlcmac_bts *gprs_rlcmac_bts; int16_t spoof_mnc = 0, spoof_mcc = 0; static void test_alloc_a(gprs_rlcmac_tbf_direction dir, const int count) @@ -47,7 +46,6 @@ static void test_alloc_a(gprs_rlcmac_tbf_direction dir, const int count) memset(&bts, 0, sizeof(bts)); bts.alloc_algorithm = alloc_algorithm_a; - gprs_rlcmac_bts = &bts; struct gprs_rlcmac_trx *trx = &bts.trx[0]; trx->pdch[2].enable = 1; -- cgit v1.2.3