documentation on internals not up to date

Marco Bodrato bodrato at mail.dm.unipi.it
Thu Apr 26 21:53:27 UTC 2018


Ciao,

Il Lun, 9 Aprile 2018 5:30 pm, Trevor Spiteri ha scritto:
> The documentation on the internals is still saying that:
[...]
> But in the current repository state, that is no longer the case.

Yes, we currently have:

Currently there's always at least one limb allocated, so for instance
@code{mpz_set_ui} never needs to reallocate, and @code{mpz_get_ui} can
fetch
@code{_mp_d[0]} unconditionally (though its value is then only wanted if
@code{_mp_size} is non-zero).

That's not current any more.
What about the following?

Currently there's always at least one readable limb, so for instance
@code{mpz_get_ui} can fetch @code{_mp_d[0]} unconditionally (though its
value is then only wanted if @code{_mp_size} is non-zero).

Also the following paragraph is not current:

@item @code{_mp_alloc}
@code{_mp_alloc} is the number of limbs currently allocated at
@code{_mp_d}, and naturally @code{_mp_alloc >= ABS(_mp_size)}.

This is not "naturally" true since GMP 6.0, when mpz_roinit_n was added to
the interface.

Shouldn't we mention that "read-only" values are possible, when
@code{_mp_alloc} is zero, but @code{_mp_size} is not.

Ĝis,
m

-- 
http://bodrato.it/papers/






More information about the gmp-bugs mailing list