-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add const where possible * Disable copy assignment and copy constructor where not safe (for now) to copy * Manual memory management -> smart pointers and vectors * De-pointerify where possible * assert -> static_assert
- Loading branch information
1 parent
ebe8ffc
commit eae138c
Showing
11 changed files
with
90 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
eae138c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ThomasHabets I'm attempting to fix gr-iridium to work with gnuradio 3.9, and I want to make sure I understand what fft.h line 86 (
fft_complex(const fft_complex&) = delete;
) accomplishes? I think I can gut the calls to that out of the gr-iridium code but I want to make sure I communicate the reason for the change in the commit.eae138c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yakkonaut it means that
fft_complex
objects are not copy constructable. They're also not copy assignable (the line below).This is because those objects have a member function
d_plan
, which is a raw pointer. There are then two options:d_plan
fft_complex
Since
d_plan
is likely a somewhat expensive operation, and it's easy in C++ to accidentally create copies when you meant to move, or RVO, or something else, it's not only simpler but also safer to not allow copying.If you copied
fft_complex
objects before this PR was merged, then that code was broken in that it destroyedd_plan
twice if there was a copy, and gave a dangling pointer as soon as the first one was destroyed.Looking at the code it seems you should just be able to remove the needless copy:
Change
d_cfo_est_fft(fft::fft_complex(d_cfo_est_fft_size * d_fft_over_size_facor, true, 1))
tod_cfo_est_fft(d_cfo_est_fft_size * d_fft_over_size_facor, true, 1)
. I'm guessing that's the line that gives you the error?eae138c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ThomasHabets thank you so so so so much for looking at this. I didn't realize the fix was that simple... glad I stopped to ask for help. That is the line that's giving me the error... will keep pressing on with that change and make sure the tests still pass. Also thank you so much for explaining what's going on with
d_plan
there. It makes sense to me now why there had to be a change.eae138c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's one more issue in that file at line 278
It's not immediately apparent to me how to solve, but flagged this for the gr-iridium maintainers as well.
eae138c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That one also looks needlessly verbose. Should just be
fft::fft_complex fft_engine(d_corr_fft_size);
.eae138c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And you're welcome. :-)