Skip to content
Snippets Groups Projects
Commit 2d0bd94f authored by Hahn, Steven's avatar Hahn, Steven
Browse files

further avoid memory allocations.

parent bd19d037
No related branches found
No related tags found
No related merge requests found
...@@ -416,10 +416,10 @@ void MDNormSCD::calculateNormalization( ...@@ -416,10 +416,10 @@ void MDNormSCD::calculateNormalization(
std::vector<std::atomic<signal_t>> signalArray(m_normWS->getNPoints()); std::vector<std::atomic<signal_t>> signalArray(m_normWS->getNPoints());
std::vector<std::array<double, 4>> intersections; std::vector<std::array<double, 4>> intersections;
std::vector<double> xValues, yValues; std::vector<double> xValues, yValues;
std::vector<coord_t> posNew(vmdDims); std::vector<coord_t> pos, posNew;
auto prog = make_unique<API::Progress>(this, 0.3, 1.0, ndets); auto prog = make_unique<API::Progress>(this, 0.3, 1.0, ndets);
#pragma omp parallel for private(intersections, xValues, yValues, \ #pragma omp parallel for private(intersections, xValues, yValues, pos, \
pos) if (Kernel::threadSafe(*integrFlux)) posNew) if (Kernel::threadSafe(*integrFlux))
for (int64_t i = 0; i < ndets; i++) { for (int64_t i = 0; i < ndets; i++) {
PARALLEL_START_INTERUPT_REGION PARALLEL_START_INTERUPT_REGION
...@@ -461,7 +461,7 @@ void MDNormSCD::calculateNormalization( ...@@ -461,7 +461,7 @@ void MDNormSCD::calculateNormalization(
// Compute final position in HKL // Compute final position in HKL
// pre-allocate for efficiency and copy non-hkl dim values into place // pre-allocate for efficiency and copy non-hkl dim values into place
std::vector<coord_t> pos(vmdDims + otherValues.size()); pos.resize(vmdDims + otherValues.size());
std::copy(otherValues.begin(), otherValues.end(), std::copy(otherValues.begin(), otherValues.end(),
pos.begin() + vmdDims - 1); pos.begin() + vmdDims - 1);
pos.push_back(1.); pos.push_back(1.);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment