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

RefAxis wastes memory by calling NumericAxis constructor. #12033

Closed
quantumsteve opened this issue Feb 27, 2015 · 2 comments
Closed

RefAxis wastes memory by calling NumericAxis constructor. #12033

quantumsteve opened this issue Feb 27, 2015 · 2 comments
Assignees
Labels
Framework Issues and pull requests related to components in the Framework
Milestone

Comments

@quantumsteve
Copy link
Contributor

This issue was originally TRAC 11194

RefAxis inherits NumericAxis and on construction calls the NumericAxis constructor. The NumericAxis constructor then initializes std::vector<double>m_values of length l. This vector is unused by RefAxis, whose values are stored in the parent workspace.

The larger issue is cases like in ticket http://trac.mantidproject.org/mantid/ticket/1179 ( http://trac.mantidproject.org/mantid/ticket/11179 ) where a member function inherited from NumericAxis used m_values instead of the parent workspace. In this particular case, the two were of different length.

@quantumsteve quantumsteve added the Framework Issues and pull requests related to components in the Framework label Jun 3, 2015
@SimonHeybrock
Copy link
Contributor

If I didn't misunderstand something, these small changes should fix the problem. All tests pass, but I did not test more than that.

@quantumsteve
Copy link
Contributor Author

@SimonHeybrock I think this is a reasonable fix to address the unused std::vector<double> initialized by NumericAxes.

I'll make another comment about a small style issue, but other than that think it's ready to be submitted as a pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Framework Issues and pull requests related to components in the Framework
Projects
None yet
Development

No branches or pull requests

2 participants