commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r10012 - openbts/branches/developers/dburgess00/trunk/


From: dburgess00
Subject: [Commit-gnuradio] r10012 - openbts/branches/developers/dburgess00/trunk/Transceiver
Date: Tue, 18 Nov 2008 14:32:52 -0700 (MST)

Author: dburgess00
Date: 2008-11-18 14:32:50 -0700 (Tue, 18 Nov 2008)
New Revision: 10012

Modified:
   openbts/branches/developers/dburgess00/trunk/Transceiver/USRPDevice.cpp
   openbts/branches/developers/dburgess00/trunk/Transceiver/USRPDevice.h
Log:
Use matched new[] and delete[] for Transceiver::currData.


Modified: 
openbts/branches/developers/dburgess00/trunk/Transceiver/USRPDevice.cpp
===================================================================
--- openbts/branches/developers/dburgess00/trunk/Transceiver/USRPDevice.cpp     
2008-11-18 06:56:00 UTC (rev 10011)
+++ openbts/branches/developers/dburgess00/trunk/Transceiver/USRPDevice.cpp     
2008-11-18 21:32:50 UTC (rev 10012)
@@ -236,7 +236,7 @@
     m_uRx->write_aux_dac(1,0,(int) ceil(0.2*4096.0/3.3)); // set to maximum 
gain 
   }
 
-  currData = (short *) malloc(200000*sizeof(short));
+  currData = new short[curDataSize];
   currTimestamp = 0;
   currLen = 0;
   timestampOffset = 0;
@@ -264,7 +264,7 @@
   m_uTx->write_io(0,(~POWER_UP|RX_TXN),(POWER_UP|RX_TXN|ENABLE));
   m_uRx->write_io(1,~POWER_UP,(POWER_UP|ENABLE));
   
-  delete currData;
+  delete[] currData;
   
   started = !(m_uRx->stop() && m_uTx->stop());
   return !started;

Modified: openbts/branches/developers/dburgess00/trunk/Transceiver/USRPDevice.h
===================================================================
--- openbts/branches/developers/dburgess00/trunk/Transceiver/USRPDevice.h       
2008-11-18 06:56:00 UTC (rev 10011)
+++ openbts/branches/developers/dburgess00/trunk/Transceiver/USRPDevice.h       
2008-11-18 21:32:50 UTC (rev 10012)
@@ -51,6 +51,7 @@
   bool started;                        ///< flag indicates USRP has started
   bool skipRx;                 ///< set if USRP is transmit-only.
 
+  static const short curDataSize = 200000;
   short *currData;             ///< internal data buffer when reading from USRP
   TIMESTAMP currTimestamp;     ///< timestamp of internal data buffer
   unsigned currLen;            ///< size of internal data buffer





reply via email to

[Prev in Thread] Current Thread [Next in Thread]