Releases: orxfun/orx-split-vec
Index and IndexMut traits are required by PinnedVec
3.5.0 Merge pull request #53 from orxfun/Index-and-IndexMut-traits-are-requ…
prevent overflow on 32_bit platforms & sort methods
- Issue leading to overflow in 32-bit platforms is fixed, thanks to @CjiW
- sort, sort_by, sort_by_key methods are implemented as required
PinnedVec
methods.
Fill-with initialization on concurrent growth
into_concurrent_filled_with
and grow_to_and_fill_with
methods are implemented to enable data structures which always have an initialized and valid state.
Support for Concurrency
Support for Concurrency
In version 2, PinnedVec grew with new methods to support concurrent data structures. However, this caused problems since these exposed methods were often unsafe, and further, they were not directly useful for the pinned vector consumers except for concurrent data structures wrapping a pinned vector. Furthermore, they are alien to a regular vector interface that we are used to using.
In version 3, a second trait called ConcurrentPinnedVec
is defined. All useful methods related with concurrent programming are moved to this trait. This trait has an associated type defining the underlying pinned vector type. It can be turned into the pinned vector.
Finally, IntoConcurrentPinnedVec
trait is defined. A pinned vector implementing this trait can be turned into a ConcurrentPinnedVec
. As explained above, it can be converted back to the pinned vector.
This bi-directional transformation allows to wrap pinned vector to have concurrent support, and unwrap whenever concurrency is not required anymore.
An important advantage of this approach is that it allowed to clean up the PinnedVec
api from unsafe and alien concurrency related methods.
Also
Tests using clock are revised so that currently pinned vector tests are miri safe.
PseudoDefault
is required for all pinned vectors. Note that a FixedVec
cannot implement a Default
, but as any type, it can implement a pseudo-default, which is also required for concurrent wrappers.
slices iterators require Default
Merge pull request #41 from orxfun/slices-iterators-require-Default slices iterators require Default
slices and initialized grow
Two slice returning methods are introduced. These methods are important in performant critical applications which allows to directly benefit from slice optimizations.
fn slices(&self, range: R)
returns an iterator of slices representing a given range of the vector.fn slices_mut(&mut self, range: R)
returns a mutable iterator of slices representing a given range of the vector.
A concurrently safe growth method method grow_and_initialize
is introduced. This methods performs capacity growth and length growth at the same time making sure that all elements are initialized with valid values.
Also unsafe get_ptr_mut_and_indices
method is implemented.
Test methods are extended accordingly.
`binary_search_by` is implemented
- Default implementations of
binary_search
andbinary_search_by_key
are provided. - Extended pinned vector tests are used, including binary search test methods.
- Additional fragment specific binary search tests are added.
IntoIterator is required for PinnedVec
- Upgraded the orx-pinned-vec dependency to version 2.9 which requires all pinned vectors to implement
IntoIterator
. IntoIter
is introduced andIntoIterator
is implemented forSplitVec
.- Further, bug in
any
reduction is fixed.
Efficient Reductions
More efficient versions of the following reduction methods are implemented for the iterator.
all
any
fold
`try_reserve_maximum_concurrent_capacity` method
try_reserve_maximum_concurrent_capacity
method is defined which is essential for concurrent wrappers such as PinnedConcurrentCol
.