-
Notifications
You must be signed in to change notification settings - Fork 9
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
#2019: add move constructor/assign to TraceScopedEvent and TraceScopedNote #2020
Conversation
Pipelines resultsPR tests (gcc-5, ubuntu, mpich) Build for 22d105f (2022-11-21 18:36:01 UTC)
PR tests (gcc-6, ubuntu, mpich) Build for 22d105f (2022-11-21 18:36:01 UTC)
PR tests (clang-3.9, ubuntu, mpich) Build for 22d105f (2022-11-21 18:36:01 UTC)
PR tests (gcc-9, ubuntu, mpich, zoltan) Build for 22d105f (2022-11-21 18:36:01 UTC)
PR tests (gcc-10, ubuntu, openmpi, no LB) Build for 22d105f (2022-11-21 18:36:01 UTC)
PR tests (clang-5.0, ubuntu, mpich) Build for 22d105f (2022-11-21 18:36:01 UTC)
PR tests (clang-9, ubuntu, mpich) Build for 22d105f (2022-11-21 18:36:01 UTC)
PR tests (gcc-7, ubuntu, mpich, trace runtime, LB) Build for 22d105f (2022-11-21 18:36:01 UTC)
PR tests (clang-11, ubuntu, mpich) Build for 22d105f (2022-11-21 18:36:01 UTC)
PR tests (clang-12, ubuntu, mpich) Build for 22d105f (2022-11-21 18:36:01 UTC)
PR tests (clang-13, alpine, mpich) Build for 22d105f (2022-11-21 18:36:01 UTC)
PR tests (clang-13, ubuntu, mpich) Build for 22d105f (2022-11-21 18:36:01 UTC)
PR tests (clang-14, ubuntu, mpich) Build for 22d105f (2022-11-21 18:36:01 UTC)
PR tests (intel icpx, ubuntu, mpich) Build for 22d105f (2022-11-21 18:36:01 UTC)
PR tests (nvidia cuda 10.1, ubuntu, mpich) Build for 22d105f (2022-11-21 18:36:01 UTC)
PR tests (gcc-11, ubuntu, mpich, json schema test) Build for 22d105f (2022-11-21 18:36:01 UTC)
PR tests (gcc-12, ubuntu, mpich) Build for 22d105f (2022-11-21 18:36:01 UTC)
PR tests (clang-10, ubuntu, mpich) Build for 22d105f (2022-11-21 18:36:01 UTC)
PR tests (nvidia cuda 11.0, ubuntu, mpich) Build for 22d105f (2022-11-21 18:36:01 UTC)
PR tests (intel icpc, ubuntu, mpich) Build for 22d105f (2022-11-21 18:36:01 UTC)
PR tests (gcc-8, ubuntu, mpich, address sanitizer) Build for 22d105f (2022-11-21 18:36:01 UTC)
|
Codecov Report
@@ Coverage Diff @@
## develop #2020 +/- ##
===========================================
- Coverage 84.50% 84.49% -0.02%
===========================================
Files 731 731
Lines 25860 25860
===========================================
- Hits 21854 21850 -4
- Misses 4006 4010 +4
|
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.
I know calling swap is idiomatic, but I'd be more comfortable if the moved from objects had their event fields assigned the no event value explicitly, moreso in the move assignment case.
For the move constructor it is set explicitly then swapped (from the initializer on event_), but for move assignment it has to use a swap to be correct if not the old value (if it is not |
I feel like if that case ever arises, it represents a logic bug, which we should maybe assert against. What's the actual use case for allowing any sort of move construction or assignment of these types? I figured it was for something like moving into a closure, where there's no existing event to be dealt with. |
One I can think of off the top of my head would be an object that needs to extend the lifetime of the TraceScopedEvent/Note until it is passed a new event. When passed a new event (lets say at the end of an iteration or something), it would need to move the new event into its storage, releasing the previous scope. |
Ok, I'll buy it. |
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.
Looks good to me.
Fixes #2019