mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2024-12-14 04:00:34 +00:00
Fixing memory allocation
This commit is contained in:
parent
59c503d38a
commit
6d1a76ba1d
@ -141,6 +141,7 @@ pcps_quicksync_acquisition_cc::~pcps_quicksync_acquisition_cc()
|
||||
delete d_code;
|
||||
delete d_possible_delay;
|
||||
delete d_corr_output_f;
|
||||
|
||||
if (d_dump)
|
||||
{
|
||||
d_dump_file.close();
|
||||
@ -155,7 +156,7 @@ void pcps_quicksync_acquisition_cc::set_local_code(std::complex<float> * code)
|
||||
lation in time in the final steps of the acquisition stage*/
|
||||
memcpy(d_code, code, sizeof(gr_complex) * d_samples_per_code);
|
||||
|
||||
d_code_folded = new gr_complex[d_fft_size]();
|
||||
gr_complex* d_code_folded = new gr_complex[d_fft_size]();
|
||||
memcpy(d_fft_if->get_inbuf(), d_code_folded, sizeof(gr_complex) * (d_fft_size));
|
||||
|
||||
/*perform folding of the code by the factorial factor parameter. Notice that
|
||||
@ -168,13 +169,13 @@ void pcps_quicksync_acquisition_cc::set_local_code(std::complex<float> * code)
|
||||
std::plus<gr_complex>());
|
||||
}
|
||||
|
||||
|
||||
d_fft_if->execute(); // We need the FFT of local code
|
||||
|
||||
//Conjugate the local code
|
||||
volk_32fc_conjugate_32fc(d_fft_codes, d_fft_if->get_outbuf(), d_fft_size);
|
||||
}
|
||||
|
||||
|
||||
void pcps_quicksync_acquisition_cc::init()
|
||||
{
|
||||
//DLOG(INFO) << "START init";
|
||||
@ -206,6 +207,7 @@ void pcps_quicksync_acquisition_cc::init()
|
||||
// DLOG(INFO) << "end init";
|
||||
}
|
||||
|
||||
|
||||
int pcps_quicksync_acquisition_cc::general_work(int noutput_items,
|
||||
gr_vector_int &ninput_items, gr_vector_const_void_star &input_items,
|
||||
gr_vector_void_star &output_items)
|
||||
@ -375,18 +377,12 @@ int pcps_quicksync_acquisition_cc::general_work(int noutput_items,
|
||||
{
|
||||
unsigned int detected_delay_samples_folded = 0;
|
||||
detected_delay_samples_folded = (indext % d_samples_per_code);
|
||||
//float d_corr_output_f[d_folding_factor];
|
||||
gr_complex complex_acumulator[100];
|
||||
//gr_complex complex_acumulator[d_folding_factor];
|
||||
//const int ff = d_folding_factor;
|
||||
//gr_complex complex_acumulator[ff];
|
||||
//gr_complex complex_acumulator[];
|
||||
//complex_acumulator = new gr_complex[d_folding_factor]();
|
||||
|
||||
for (int i = 0; i < (int)d_folding_factor; i++)
|
||||
{
|
||||
d_possible_delay[i] = detected_delay_samples_folded +
|
||||
(i)*d_fft_size;
|
||||
d_possible_delay[i] = detected_delay_samples_folded + (i)*d_fft_size;
|
||||
}
|
||||
|
||||
for ( int i = 0; i < (int)d_folding_factor; i++)
|
||||
@ -472,9 +468,6 @@ int pcps_quicksync_acquisition_cc::general_work(int noutput_items,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
delete d_code_folded;
|
||||
volk_free(in_temp);
|
||||
volk_free(in_temp_folded);
|
||||
volk_free(in_1code);
|
||||
|
Loading…
Reference in New Issue
Block a user