Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/fmpz/link/fmpz_single.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,12 @@ void _fmpz_clear_mpz(fmpz f)
} else
{
if (ptr->_mp_alloc > FLINT_MPZ_MAX_CACHE_LIMBS)
mpz_realloc(ptr, MPZ_MIN_ALLOC);
{
/* Don't use mpz_realloc2 here; a plain realloc may hang on
to an oversized chunk. */
mpz_clear(ptr);
mpz_init2(ptr, MPZ_MIN_ALLOC * FLINT_BITS);
}

if (mpz_free_num == mpz_free_alloc)
{
Expand Down
Loading