Using MPZ_ROINIT_N in mpz sources
bodrato at mail.dm.unipi.it
Mon Nov 28 07:13:04 UTC 2016
Il Dom, 27 Novembre 2016 10:30 am, Niels Möller ha scritto:
> "Marco Bodrato" <bodrato at mail.dm.unipi.it> writes:
>> Moreover, can we slightly abuse it to obtain a static lazy init w/out
>> calling the _init function? E.g.
> If we want to do that, I think we should have a separate macro for the
> initializer (and preferably point to some shared read-only limb). Or
> make mpz_init inline?
A single shared limb is my goal too, but it's a cost (comparable to a
function call?) if we must use a shared symbol for it. IIRC Torbjörn said
that the symbol hiding stuff might not be able to mitigate this cost,
because of the PIC-only policy of some Linux distributions...
On the other side, inlining a function with a static const var inside
means, I believe, replicating lots of statics variables everywhere...
A separate macro would be good for readability and maintainability, you
Which kind of macro do you suggest?
One to be used in the declaration phase:
mpz_t temp = MPZ_PREINIT(...);
or a macro to be inserted in the code:
More information about the gmp-devel