From 0ae7141ee60286ca01fdbd01b21d608029310165 Mon Sep 17 00:00:00 2001 From: Marco Bodrato Date: Tue, 24 Mar 2020 17:49:46 +0100 Subject: mpz/nextprime.c: Update some comments. --- mpz/nextprime.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'mpz') diff --git a/mpz/nextprime.c b/mpz/nextprime.c index a986058a0..5302f7c1a 100644 --- a/mpz/nextprime.c +++ b/mpz/nextprime.c @@ -109,7 +109,7 @@ calculate_sievelimit(mp_bitcnt_t nbits) { } else { - /* Larger threshold is faster but takes ~O(n/ln(n)) memory. + /* Larger threshold is faster but takes (n/ln(n) + n/24) memory. * For 33,000 bits limitting to 150M is ~12% slower than using the * optimal 1.5G sieve_limit. */ @@ -168,6 +168,10 @@ mpz_nextprime (mpz_ptr p, mpz_srcptr n) up to the gap 304599508537+514=304599509051 . With the current code our limit is 436273009+282=436273291 */ ASSERT (sieve_limit < 436273291); + /* THINK: Memory used by both sieve and primegap_tmp is kept + allocated, but they may overlap if primegap is filled from + larger down to smaller primes... + */ /* Needed to avoid assignment of read-only location */ primegap_tmp = TMP_ALLOC_TYPE (prime_limit, unsigned char); -- cgit v1.2.1