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
Reduce boost use in EventFilter/Utilities #30181
Reduce boost use in EventFilter/Utilities #30181
Conversation
The code-checks are being triggered in jenkins. |
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-30181/16000
|
A new Pull Request was created by @camolezi (Lucas Camolezi) for master. It involves the following packages: EventFilter/Utilities @perrotta, @mommsen, @cmsbuild, @emeschi, @slava77 can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
@@ -22,7 +24,7 @@ class RawEventFileWriterForBU { | |||
~RawEventFileWriterForBU(); | |||
|
|||
void doOutputEvent(FRDEventMsgView const& msg); | |||
void doOutputEvent(boost::shared_array<unsigned char>& msg){}; | |||
void doOutputEvent(std::shared_ptr<std::vector<unsigned char>>& msg){}; |
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.
It seems that this method is not used anywhere. @smorovic, can it be removed?
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.
yes, it looks obsolete (same also for doOutputEventFragment).
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.
if (templateConsumer_->sharedMode())
templateConsumer_->doOutputEvent(workBuffer);
else
this should also go away if definition is gone (it's safe, because shared mode is always false)
@@ -107,8 +108,8 @@ void RawEventOutputModuleForBU<Consumer>::write(edm::EventForOutput const& e) { | |||
|
|||
totsize += expectedSize; | |||
// build the FRDEvent into a temporary buffer | |||
boost::shared_array<unsigned char> workBuffer(new unsigned char[expectedSize + 256]); | |||
uint32* bufPtr = (uint32*)workBuffer.get(); | |||
std::shared_ptr<std::vector<unsigned char>> workBuffer(new std::vector<unsigned char>(expectedSize + 256)); |
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.
A unique ptr should be enough here, isn't it? How about using std::make_unique instead of the 'new'?
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.
Now that you mentioned, I agree, a unique_ptr should probably be enough here.
67f8d8f
to
7ed8acf
Compare
The code-checks are being triggered in jenkins. |
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-30181/16001
|
please test |
The tests are being triggered in jenkins. |
+1 |
Comparison job queued. |
+1 |
Comparison is ready Comparison Summary:
|
+1
|
This pull request is fully signed and it will be integrated in one of the next master IBs (tests are also fine). This pull request will now be reviewed by the release team before it's merged. @silviodonato, @dpiparo (and backports should be raised in the release meeting by the corresponding L2) |
+1 |
PR description:
Replaced boost library use for C++ STL alternatives. A shared_ptr to a std::vector should have similar behavior as a boost::shared_vector.
PR validation:
Passed on basic runTheMatrix test.
if this PR is a backport please specify the original PR and why you need to backport that PR:
@vgvassilev @davidlange6