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
Avoid some unnecessary memory allocations #7245
Conversation
In RefVectorIterator::operator->() avoid some unnecessary calls to new that allocate memory by returning by value a proxy to a Ref instead of an auto_ptr to a Ref.
A new Pull Request was created by @wddgit (W. David Dagenhart) for CMSSW_7_4_X. Avoid some unnecessary memory allocations It involves the following packages: DataFormats/Common @cmsbuild, @Dr15Jones, @ktf, @nclopezo can you please review it and eventually sign? Thanks. |
class RefProxy { | ||
public: | ||
RefProxy(value_type const& ref) : ref_(ref) { } | ||
value_type* operator->() { return &ref_; } |
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.
This needs to be a const value_type*
since the RefProxy
is only used by a const_iterator
.
Pull request #7245 was updated. @cmsbuild, @Dr15Jones, @ktf, @nclopezo can you please check and sign again. |
+1 |
Please test |
The tests are being triggered in jenkins. |
This pull request is fully signed and it will be integrated in one of the next CMSSW_7_4_X IBs unless changes or unless it breaks tests. |
This pull request is fully signed and it will be integrated in one of the next CMSSW_7_4_X IBs unless changes (tests are also fine). This pull request will be automatically merged. |
Avoid some unnecessary memory allocations
In RefVectorIterator::operator->() avoid
some unnecessary calls to new that allocate
memory by returning by value a proxy to
a Ref instead of an auto_ptr to a Ref.