Best way to import without copy

Julien D Arques acc.gccquestions at gmail.com
Thu May 4 08:03:17 CEST 2023


thanks Marc

On Thu, 4 May 2023 at 00:25, Marc Glisse <marc.glisse at inria.fr> wrote:

> On Wed, 3 May 2023, Julien D Arques wrote:
>
> > I currently use mpz_import, but reading the source code, it appears that
> > gmp copies the already allocated buffer I give it.
> > That's double the work, and the said buffer is big.
>
> Depending on endianness and other criteria, this might not be a simple
> copy.
>
> > Is there a correct/reliable way to avoid that?
>
> If you are certain the format is right, you could try mpz_roinit_n.
>
> --
> Marc Glisse
>


More information about the gmp-discuss mailing list