Skip to content

primesieve-11.0

Compare
Choose a tag to compare
@kimwalisch kimwalisch released this 06 Dec 17:56
· 250 commits to master since this release

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 new primesieve::iterator::jump_to().
  • iterator.cpp: Fix use after free in primesieve::iterator::clear().
  • iterator-c.cpp: Add new primesieve_jump_to().
  • iterator-c.cpp: Mark primesieve_skipto() as deprecated.
  • iterator-c.cpp: Fix use after free in primesieve_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: Use std::initializer_list instead of std::vector.
  • Erat.cpp: Improve documentation.
  • C_API.md: Improve next_prime() and prev_prime() documentation.
  • CPP_API.md: Improve next_prime() and prev_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().