Skip to content

Commit

Permalink
Removed use of static in DefaultMeasure::UpdateAxesFast
Browse files Browse the repository at this point in the history
The use of static arrays in DefaultMeasure::UpdateAxesFast caused
thread-safety problems. The stated reason for using the arrays
was to avoid allocation/deallocation but that was also achievable
by having the arrays just be on the stack.
  • Loading branch information
Dr15Jones committed Dec 9, 2015
1 parent d53aaa4 commit e93521f
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions Nsubjettiness/MeasureDefinition.cc
Original file line number Diff line number Diff line change
Expand Up @@ -383,13 +383,8 @@ std::vector<LightLikeAxis> DefaultMeasure::UpdateAxesFast(const std::vector <Lig
) const {
assert(old_axes.size() == N);

// some storage, declared static to save allocation/re-allocation costs
static LightLikeAxis new_axes[N];
static fastjet::PseudoJet new_jets[N];
for (int n = 0; n < N; ++n) {
new_axes[n].reset(0.0,0.0,0.0,0.0);
new_jets[n].reset_momentum(0.0,0.0,0.0,0.0);
}
LightLikeAxis new_axes[N];
fastjet::PseudoJet new_jets[N];

double precision = accuracy; //TODO: actually cascade this in

Expand Down

0 comments on commit e93521f

Please sign in to comment.