Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor interpl linked list to use std::unique_ptr #2736

Merged
merged 4 commits into from
Nov 6, 2023

Conversation

rmu75
Copy link
Contributor

@rmu75 rmu75 commented Nov 6, 2023

continuing the work from #2486 this refactors NML_INTERP_LIST

  • use std::unique_ptr instead of NMLmsg*
  • adapt task to allocate message with std::make_unique

improvements:

  • avoids multiple copying of message contents
  • avoids some dynamic allocations in std::vector
  • potentially saves heap space
  • clear ownership / lifetime of message
  • next step to more idiomatic use of standard library

rmu75 added 4 commits November 3, 2023 13:08
* use std::unique_ptr<NMLmsg> instead of NMLmsg*
* adapt task to allocate message with std::make_unique

improvements:
* avoids multiple copying of message contents
* avoids some dynamic allocations in std::vector
* potentially saves heap space
* clear ownership / lifetime of message
* next step to more idiomatic use of standard library
@rmu75 rmu75 marked this pull request as ready for review November 6, 2023 19:20
@rene-dev rene-dev merged commit 6d65386 into LinuxCNC:master Nov 6, 2023
@rmu75 rmu75 deleted the rs/std-interp-list branch November 6, 2023 21:25
@royka1
Copy link

royka1 commented Jun 19, 2024

@rmu75 This commit causes that the M67/M68 codes already get applied during the motion of the previous line, can you see where it goes wrong?

#2987

@rmu75
Copy link
Contributor Author

rmu75 commented Jun 19, 2024

@royka1 I will look into it, no idea at the moment.

@rmu75
Copy link
Contributor Author

rmu75 commented Jun 19, 2024

It seems I inadvertently removed some calls to flush_segments() in emccanon.cc -- I will prepare a patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants