Skip to content

Improvement of L1Vector, 2 bug fixes

Sergey Gorbunov requested to merge se.gorbunov/cbmroot:L1VectorPR into master

new L1Vector class:

/// L1Vector class is a wrapper around std::vector.
/// It does the following:
/// 1. resizes the vector without initializing the new elements
/// 2. controls the out-of-range access in debug mode
/// 3. warns when the preallocated capacity is not big enough
/// 4. blocks usage of boolean vectors, as they have a special
///    space-optimized but slow implementation in std. (Use L1Vector<char> instead).

Additionally, there is a bug fix in the OpenMP part: the wrong size of the OpenMP lock array. Without this bugfix, the new L1Vector generates an error in one of the tests. So I have to include it in this MR.

@f.uhlig, there is a hope that this OpenMP bugfix also resolves the old problem with OpenMP on MacOsX: https://redmine.cbm.gsi.de/issues/2138

Edited by Sergey Gorbunov

Merge request reports