primesieve-11.0
This version fixes two annoying libprimesieve issues. Firstly, from now on the shared libprimesieve version (.so
version) will match the primesieve version. This makes it easier to depend on libprimesieve and to update to the latest libprimesieve. Secondly, primesieve_jump_to()
has been added to libprimesieve's API. The new primesieve_jump_to(iter, start, stop)
includes the start number (generates primes ≥ start), whereas the old primesieve_skipto(iter, start, stop)
excludes the start number (generates primes > start). In practice, the use of
primesieve_jump_to()
requires up to 2x less start number corrections (e.g. start-1) compared to primesieve_skipto()
.
C API deprecations
The libprimesieve C API and ABI are backwards compatible with libprimesieve ≥ 10.0. However, the primesieve_skipto()
function from the libprimesieve C API has been marked as deprecated, please use the new primesieve_jump_to()
instead.
C++ API breaking changes
Unlike the C API, in the C++ API the primesieve::iterator::skipto()
method has been replaced by primesieve::iterator::jump_to()
. The new method includes the start number whereas the old method excluded the start number. The primesieve::iterator
constructors now also include the start number while they previously excluded the start number. Please read the documentation for more information.
ChangeLog
CMakeLists.txt
: Improve Emscripten WebAssembly support.iterator.cpp
: Add newprimesieve::iterator::jump_to()
.iterator.cpp
: Fix use after free inprimesieve::iterator::clear()
.iterator-c.cpp
: Add newprimesieve_jump_to()
.iterator-c.cpp
: Markprimesieve_skipto()
as deprecated.iterator-c.cpp
: Fix use after free inprimesieve_iterator_clear()
.pod_vector.hpp
: Added support for types with destructors.malloc_vector.hpp
: Fix potential memory leak.api.cpp
: Support non power of 2 sieve sizes.PrimeSieve.cpp
: Support non power of 2 sieve sizes.PreSieve.cpp
: Usestd::initializer_list
instead ofstd::vector
.Erat.cpp
: Improve documentation.C_API.md
: Improvenext_prime()
andprev_prime()
documentation.CPP_API.md
: Improvenext_prime()
andprev_prime()
documentation.
Acknowledgements
I would like to thank Philip Vetter for his detailed feedback on the libprimesieve API, which caused me to create the new primesieve_jump_to()
.