From cff314cbc8201bca12669943a6bd9c7af145ae64 Mon Sep 17 00:00:00 2001 From: Jared Boone Date: Wed, 3 Feb 2016 19:59:41 -0800 Subject: [PATCH] Convince compiler to not inline member constructors. --- firmware/baseband/dsp_decimate.cpp | 9 +++++++++ firmware/baseband/dsp_decimate.hpp | 10 ++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/firmware/baseband/dsp_decimate.cpp b/firmware/baseband/dsp_decimate.cpp index abd8e7d0..9b417d85 100644 --- a/firmware/baseband/dsp_decimate.cpp +++ b/firmware/baseband/dsp_decimate.cpp @@ -645,6 +645,15 @@ buffer_s16_t FIR64AndDecimateBy2Real::execute( return { dst.p, src.count / 2, src.sampling_rate / 2 }; } +void FIRAndDecimateComplex::configure_common( + const size_t taps_count, const size_t decimation_factor +) { + samples_ = std::make_unique(taps_count); + taps_reversed_ = std::make_unique(taps_count); + taps_count_ = taps_count; + decimation_factor_ = decimation_factor; +} + buffer_c16_t FIRAndDecimateComplex::execute( const buffer_c16_t& src, const buffer_c16_t& dst diff --git a/firmware/baseband/dsp_decimate.hpp b/firmware/baseband/dsp_decimate.hpp index 1a9bf303..52727075 100644 --- a/firmware/baseband/dsp_decimate.hpp +++ b/firmware/baseband/dsp_decimate.hpp @@ -241,12 +241,14 @@ private: const size_t taps_count, const size_t decimation_factor ) { - samples_ = std::make_unique(taps_count); - taps_reversed_ = std::make_unique(taps_count); - taps_count_ = taps_count; - decimation_factor_ = decimation_factor; + configure_common(taps_count, decimation_factor); std::reverse_copy(&taps[0], &taps[taps_count], &taps_reversed_[0]); } + + void configure_common( + const size_t taps_count, + const size_t decimation_factor + ); }; class DecimateBy2CIC4Real {