]> git.ipfire.org Git - thirdparty/coreutils.git/commit
factor: speed up Pollard-rho loop counters
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 7 Jul 2025 03:18:10 +0000 (20:18 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 10 Jul 2025 00:12:40 +0000 (17:12 -0700)
commitef456bef37d1d047d62e137895e743e157041ffa
tree3c1e3bc9d9c0188658384765ed400d62b736f0e6
parent033a50af8ba71f521b638d88309bd15421059e83
factor: speed up Pollard-rho loop counters

* src/factor.c (factor_using_pollard_rho)
(factor_using_pollard_rho2, mp_factor_using_pollard_rho):
Use int, not unsigned long int, for counters that won’t go above
2**31 on practical platforms.  This yields a significant speedup
on GCC 15 x86-64, and using signed values allows for automatic
checks for overflow when using gcc -fsanitize=undefined.
src/factor.c