Change in osmo-trx[master]: lms: Move rx_buffers allocation to constructor

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

pespin gerrit-no-reply at lists.osmocom.org
Tue Jan 14 19:24:13 UTC 2020


pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-trx/+/16875 )


Change subject: lms: Move rx_buffers allocation to constructor
......................................................................

lms: Move rx_buffers allocation to constructor

Release is done in destructor, so let's move allocation to constructor
since there's really no need to have them in open() which is already
quite complex and large.

Change-Id: I8a4fd973590c4c165abd8f2837b2da8fc14a2066
---
M Transceiver52M/device/lms/LMSDevice.cpp
1 file changed, 5 insertions(+), 4 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/75/16875/1

diff --git a/Transceiver52M/device/lms/LMSDevice.cpp b/Transceiver52M/device/lms/LMSDevice.cpp
index cb0129a..a533e7e 100644
--- a/Transceiver52M/device/lms/LMSDevice.cpp
+++ b/Transceiver52M/device/lms/LMSDevice.cpp
@@ -58,6 +58,11 @@
 	tx_gains.resize(chans);
 
 	rx_buffers.resize(chans);
+
+	/* Set up per-channel Rx timestamp based Ring buffers */
+	for (size_t i = 0; i < rx_buffers.size(); i++)
+		rx_buffers[i] = new smpl_buf(SAMPLE_BUF_SZ / sizeof(uint32_t));
+
 }
 
 LMSDevice::~LMSDevice()
@@ -243,10 +248,6 @@
 		goto out_close;
 	}
 
-	/* Set up per-channel Rx timestamp based Ring buffers */
-	for (size_t i = 0; i < rx_buffers.size(); i++)
-		rx_buffers[i] = new smpl_buf(SAMPLE_BUF_SZ / sizeof(uint32_t));
-
 	return NORMAL;
 
 out_close:

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/16875
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Change-Id: I8a4fd973590c4c165abd8f2837b2da8fc14a2066
Gerrit-Change-Number: 16875
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200114/b394f649/attachment.htm>


More information about the gerrit-log mailing list