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/.
Pau Espin Pedrol gerrit-no-reply at lists.osmocom.orgPau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/13782
Change subject: lms: flush_recv: alloc buf on stack instead of heap
......................................................................
lms: flush_recv: alloc buf on stack instead of heap
No need to use the heap here since buffer is only used as a temporary
trash. Using the stack is quicker.
Change-Id: Iede8dc0903ee3865a52c8e2fd811bcde444fee33
---
M Transceiver52M/device/lms/LMSDevice.cpp
1 file changed, 1 insertion(+), 3 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/82/13782/1
diff --git a/Transceiver52M/device/lms/LMSDevice.cpp b/Transceiver52M/device/lms/LMSDevice.cpp
index 05904e8..064d742 100644
--- a/Transceiver52M/device/lms/LMSDevice.cpp
+++ b/Transceiver52M/device/lms/LMSDevice.cpp
@@ -450,7 +450,7 @@
{
#define CHUNK 625
int len = CHUNK * tx_sps;
- short *buffer = new short[len * 2];
+ short *buffer = (short*) alloca(sizeof(short) * len * 2);
int rc;
lms_stream_meta_t rx_metadata = {};
rx_metadata.flushPartialPacket = false;
@@ -463,7 +463,6 @@
LOGC(DDEV, DEBUG) << "Flush: Recv buffer of len " << rc << " at " << std::hex << rx_metadata.timestamp;
if (rc != len) {
LOGC(DDEV, ALERT) << "LMS: Device receive timed out";
- delete[] buffer;
return false;
}
@@ -471,7 +470,6 @@
}
LOGC(DDEV, INFO) << "Initial timestamp " << ts_initial << std::endl;
- delete[] buffer;
return true;
}
--
To view, visit https://gerrit.osmocom.org/13782
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iede8dc0903ee3865a52c8e2fd811bcde444fee33
Gerrit-Change-Number: 13782
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190425/abf8286d/attachment.htm>