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

Avoid some unnecessary memory allocations #7245

Merged
merged 2 commits into from Jan 17, 2015

Conversation

wddgit
Copy link
Contributor

@wddgit wddgit commented Jan 16, 2015

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.

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.
@cmsbuild
Copy link
Contributor

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.
@wmtan this is something you requested to watch as well.
You can sign-off by replying to this message having '+1' in the first line of your reply.
You can reject by replying to this message having '-1' in the first line of your reply.
If you are a L2 or a release manager you can ask for tests by saying 'please test' in the first line of a comment.

class RefProxy {
public:
RefProxy(value_type const& ref) : ref_(ref) { }
value_type* operator->() { return &ref_; }
Copy link
Contributor

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.

@cmsbuild
Copy link
Contributor

Pull request #7245 was updated. @cmsbuild, @Dr15Jones, @ktf, @nclopezo can you please check and sign again.

@Dr15Jones
Copy link
Contributor

+1

@Dr15Jones
Copy link
Contributor

Please test

@cmsbuild
Copy link
Contributor

The tests are being triggered in jenkins.

@cmsbuild
Copy link
Contributor

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.

@cmsbuild
Copy link
Contributor

@cmsbuild
Copy link
Contributor

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.

cmsbuild added a commit that referenced this pull request Jan 17, 2015
Avoid some unnecessary memory allocations
@cmsbuild cmsbuild merged commit 9d34ee2 into cms-sw:CMSSW_7_4_X Jan 17, 2015
@cmsbuild
Copy link
Contributor

@wddgit wddgit deleted the refVectorIterator branch May 19, 2015 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants