aboutsummaryrefslogtreecommitdiffstats
path: root/tests/alloc
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-10-17 19:41:11 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-10-30 21:20:45 +0100
commitb6acfdaa24851e1aa95bfc4611709737aaafa5f1 (patch)
tree77ccb6c9ba4d387381fd82e3768189a6e7a334a7 /tests/alloc
parent67ed34eedb59320095396ff2f65f360c046d88c5 (diff)
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.
Diffstat (limited to 'tests/alloc')
-rw-r--r--tests/alloc/AllocTest.cpp2
1 files changed, 0 insertions, 2 deletions
diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp
index 3d58f50..3b75763 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;