diff options
author | Thomas Habets <thomas@habets.se> | 2020-08-29 23:18:16 +0100 |
---|---|---|
committer | Martin Braun <martin@gnuradio.org> | 2020-09-07 05:14:14 -0700 |
commit | d2c9de98b52e7e9a4918190b1e7079496d2a13b6 (patch) | |
tree | 74b9de2495d7e4ab79dd13bbf6338ca2fb1e2501 /gr-fec/lib/polar_encoder_systematic.cc | |
parent | 0d1d600ab622075a4e56e66642e67fc5c983450e (diff) |
fec: Remove manual memory management
This removes almost all manual memory management in gr-fec/.
`scl_list` is a bit of magic, so requires more thinking.
Diffstat (limited to 'gr-fec/lib/polar_encoder_systematic.cc')
-rw-r--r-- | gr-fec/lib/polar_encoder_systematic.cc | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/gr-fec/lib/polar_encoder_systematic.cc b/gr-fec/lib/polar_encoder_systematic.cc index b77f5e0730..ddf898d8b0 100644 --- a/gr-fec/lib/polar_encoder_systematic.cc +++ b/gr-fec/lib/polar_encoder_systematic.cc @@ -31,16 +31,12 @@ polar_encoder_systematic::polar_encoder_systematic(int block_size, int num_info_bits, std::vector<int> frozen_bit_positions) : polar_common( - block_size, num_info_bits, frozen_bit_positions, std::vector<uint8_t>()) + block_size, num_info_bits, frozen_bit_positions, std::vector<uint8_t>()), + d_volk_syst_intermediate(block_size) { - d_volk_syst_intermediate = (unsigned char*)volk_malloc( - sizeof(unsigned char) * block_size, volk_get_alignment()); } -polar_encoder_systematic::~polar_encoder_systematic() -{ - volk_free(d_volk_syst_intermediate); -} +polar_encoder_systematic::~polar_encoder_systematic() {} void polar_encoder_systematic::generic_work(void* in_buffer, void* out_buffer) { @@ -48,8 +44,8 @@ void polar_encoder_systematic::generic_work(void* in_buffer, void* out_buffer) unsigned char* out = (unsigned char*)out_buffer; volk_encode(out, in); - bit_reverse_and_reset_frozen_bits(d_volk_syst_intermediate, out); - volk_encode_block(out, d_volk_syst_intermediate); + bit_reverse_and_reset_frozen_bits(d_volk_syst_intermediate.data(), out); + volk_encode_block(out, d_volk_syst_intermediate.data()); } void polar_encoder_systematic::bit_reverse_and_reset_frozen_bits( |