emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Change module interface to no longer use GMP objects directl


From: Eli Zaretskii
Subject: Re: [PATCH] Change module interface to no longer use GMP objects directly.
Date: Mon, 09 Dec 2019 15:19:50 +0200

> Cc: address@hidden, address@hidden, address@hidden,
>  address@hidden
> From: Paul Eggert <address@hidden>
> Date: Sun, 8 Dec 2019 16:35:13 -0800
> 
> With that in mind, perhaps we should replace the above 7 lines with 
> these 2 lines:
> 
> typedef unsigned long long emacs_limb_t;
> #define EMACS_LIMB_MAX ULLONG_MAX

I don't mind doing this, but then we should remove this comment from
emacs-module.c, or reword it so that it says nothing about optimality
of matching emacs_limb_t and mp_limb_t:

  For the magnitude we pick an array of an unsigned integer type similar
  to mp_limb_t instead of e.g. unsigned char.  This matches in most
  cases the representation of a GMP limb.  In such cases GMP picks an
  optimized algorithm for mpz_import and mpz_export that boils down to a
  single memcpy to convert the magnitude.  This way we largely avoid the
  import/export overhead on most platforms.

because the suggestion means we don't really care about how optimal
this is.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]