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
Wed Jan 15 15:00:28 UTC 2020


pespin has submitted this change. ( 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(-)

Approvals:
  laforge: Looks good to me, but someone else must approve
  pespin: Looks good to me, approved
  fixeria: Looks good to me, but someone else must approve
  Jenkins Builder: Verified



diff --git a/Transceiver52M/device/lms/LMSDevice.cpp b/Transceiver52M/device/lms/LMSDevice.cpp
index 3d2b68e..8ad338b 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: 2
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <axilirator at gmail.com>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200115/ad4482b9/attachment.htm>


More information about the gerrit-log mailing list