]> git.ipfire.org Git - thirdparty/coreutils.git/commit
factor: avoid an mpz init+clear
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 6 Jul 2025 20:59:56 +0000 (13:59 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 10 Jul 2025 00:12:40 +0000 (17:12 -0700)
commit033a50af8ba71f521b638d88309bd15421059e83
treec5242c4a6a0265cdede7b3fe22d7dd06a487f348
parent2ba421644138e43a8eb31513f8ea441696bc4b64
factor: avoid an mpz init+clear

* src/factor.c (mp_factor_insert_ui): Rename fom
mp_factor_insert_ui, and change arg type from unsigned long int to
mp_limb_t.  All uses changed.  This avoids creating and freeing a
small mpz_t.
(mp_factor_using_division): Add a static assert requiring that
that mp_limb_t be wide enough, which it should be (and is in
standard GMP).
src/factor.c