summaryrefslogtreecommitdiff
path: root/gr-qtgui/lib/sink_c_impl.cc
diff options
context:
space:
mode:
authorTom Rondeau <tom@trondeau.com>2014-02-11 15:07:29 -0500
committerTom Rondeau <tom@trondeau.com>2014-02-11 15:07:29 -0500
commit0c226aa65ef6c5427708cffca71e5dfb1cebecb5 (patch)
tree5d7b4dc851b1cf9a10b30d85df0f6483dff717a1 /gr-qtgui/lib/sink_c_impl.cc
parent11993810427c3323d190cafde5be12461530d1fb (diff)
qtgui: in sink_c and sink_f, use volk_malloc/volk_free instead of new for buffers.
Diffstat (limited to 'gr-qtgui/lib/sink_c_impl.cc')
-rw-r--r--gr-qtgui/lib/sink_c_impl.cc30
1 files changed, 17 insertions, 13 deletions
diff --git a/gr-qtgui/lib/sink_c_impl.cc b/gr-qtgui/lib/sink_c_impl.cc
index ddeabf80c4..d9341bab88 100644
--- a/gr-qtgui/lib/sink_c_impl.cc
+++ b/gr-qtgui/lib/sink_c_impl.cc
@@ -31,7 +31,7 @@
namespace gr {
namespace qtgui {
-
+
sink_c::sptr
sink_c::make(int fftsize, int wintype,
double fc, double bw,
@@ -78,11 +78,13 @@ namespace gr {
// this is usually desired when plotting
d_shift = true;
- d_fft = new fft::fft_complex (d_fftsize, true);
+ d_fft = new fft::fft_complex(d_fftsize, true);
d_index = 0;
- d_residbuf = new gr_complex[d_fftsize];
- d_magbuf = new float[d_fftsize];
+ d_residbuf = (gr_complex*)volk_malloc(d_fftsize*sizeof(gr_complex),
+ volk_get_alignment());
+ d_magbuf = (float*)volk_malloc(d_fftsize*sizeof(float),
+ volk_get_alignment());
buildwindow();
@@ -92,10 +94,10 @@ namespace gr {
sink_c_impl::~sink_c_impl()
{
delete d_main_gui;
- delete [] d_residbuf;
- delete [] d_magbuf;
delete d_fft;
delete d_argv;
+ volk_free(d_residbuf);
+ volk_free(d_magbuf);
}
bool
@@ -272,14 +274,16 @@ namespace gr {
if(newfftsize != d_fftsize) {
// Resize residbuf and replace data
- delete [] d_residbuf;
- d_residbuf = new gr_complex[newfftsize];
+ volk_free(d_residbuf);
+ d_residbuf = (gr_complex*)volk_malloc(newfftsize*sizeof(gr_complex),
+ volk_get_alignment());
- delete [] d_magbuf;
- d_magbuf = new float[newfftsize];
+ volk_free(d_magbuf);
+ d_magbuf = (float*)volk_malloc(newfftsize*sizeof(float),
+ volk_get_alignment());
- // Set new fft size and reset buffer index
- // (throws away any currently held data, but who cares?)
+ // Set new fft size and reset buffer index
+ // (throws away any currently held data, but who cares?)
d_fftsize = newfftsize;
d_index = 0;
@@ -328,7 +332,7 @@ namespace gr {
j += resid;
fft(d_magbuf, d_residbuf, d_fftsize);
-
+
d_main_gui->updateWindow(true, d_magbuf, d_fftsize,
NULL, 0, (float*)d_residbuf, d_fftsize,
currentTime, true);