aboutsummaryrefslogtreecommitdiffstats
path: root/Transceiver52M/signalVector.h
AgeCommit message (Collapse)AuthorFilesLines
2018-12-05SigProcLib: Improve Vector buffer allocation messPau Espin Pedrol1-3/+3
Original issue: In order to use SSE instructions, 16-byte aligned memory chunks are needed, and C++ version < C++11 doesn't provide for a native new/delete store. For that reason, memalign() must be used in the implementation of convolve_h_alloc() for some buffers. On the other side, The C++ code relies on C++ "new T[]" operator to allocate a chunk of memory containing an array of class instances. As classes are complex types, they cannot be allocated through C structures (calling malloc). Experimentally can be seen too that it's unreliable and the process will crash during startup if malloc() is used and then a Complex<> deferred from it. Previous implementation allowed for use of convolve_h_alloc or new[] based on how the (signal)Vector is called, because then the buffer is not going to be managed internally. But that's unreliable since resize() calling resize() on it could use "delete" operator on a malloc'ed buffer, and end up having a new new[] allocated buffer. It was also found that some of the callers were actually leaking memory through ASan (because the buffer is not managed by the Vector instance). IMHO best option would be to rewrite all this code using C structures and malloc/free exclusively, since it would make all this cod eeasier to maintain. But for now, let's extend the Vector class to allow specifying an external alloc/free function and let the Vector instance take care of the ownership of the buffer in all scenarios. Change-Id: Ie484a4762a7f77fe1b105188ea03a6f025730b82
2017-03-24signalVector: Implement segment().Alexander Chemeris1-0/+3
Change-Id: I6fe3aae53fb2fa5bb7637e976de6059eabe08202
2016-07-01iface: Add inner ring-buffer implementationTom Tsou1-0/+1
Two buffers, inner and outer, are used in the transceiver implementation. The outer buffer interfaces with the device receive interface to guarantee timestamp aligned and contiguously allocated sample buffers. The inner buffer absorbs vector size differences between GSM bursts (156 or 157 samples) and the resampler interface (typically fixed multiples of 65). Reimplement the inner buffer with a ring buffer that allows fixed size segments on the outer (resampler) portion and variable lengths (GSM side) on the inner side. Compared to the previous stack-like version, this implementation removes unnecessary copying of buffer contents. Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2013-11-15Transceiver52M: Enable all warnings and resolveThomas Tsou1-1/+1
Mainly basic signed vs unsigned comparisons and intializer ordering. Signed-off-by: Thomas Tsou <tom@tsou.cc>
2013-11-15Transceiver52M: Separate signalVector into it's own fileThomas Tsou1-0/+51
Break out the signalVector object and clean up the interface in the process. Signed-off-by: Thomas Tsou <tom@tsou.cc>