commit fede1096daa309acac7d2ba3f7d00ba6d224d081
parent 097ecfb7ec50b743edf82b34000454feb1475436
Author: Christian Grothoff <grothoff@gnunet.org>
Date: Wed, 6 Dec 2023 23:15:12 +0900
-remove mp_alloc
Diffstat:
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/source/montgomery.cl b/source/montgomery.cl
@@ -212,14 +212,10 @@ typedef const mp_limb_t *mp_srcptr;
typedef struct
{
- int _mp_alloc; /* Number of *limbs* allocated and pointed
- to by the _mp_d field. */
int _mp_size; /* abs(_mp_size) is the number of limbs the
last field points to. If _mp_size is
negative this is a negative number. */
- //mp_limb_t *_mp_d; /* Pointer to the limbs. */
-
- mp_limb_t _mp_d[256];
+ mp_limb_t _mp_d[256];
} __mpz_struct;
@@ -445,7 +441,6 @@ mpz_set_lg (unsigned long *r, __global unsigned long *x);
void
mpz_init (mpz_t r)
{
- r->_mp_alloc = 0;
r->_mp_size = 0;
for (int i = 0; i < 256; i++) {
r->_mp_d[i] = 0;
@@ -562,7 +557,6 @@ mpz_init2 (mpz_t r, mp_bitcnt_t bits)
bits -= (bits != 0); /* Round down, except if 0 */
rn = 1 + bits / GMP_LIMB_BITS;
- r->_mp_alloc = rn;
r->_mp_size = 0;
}
@@ -963,9 +957,6 @@ mpz_addmul (mpz_t r, const mpz_t u, const mpz_t v)
void
mpz_swap (mpz_t u, mpz_t v)
{
- //MP_SIZE_T_SWAP (u->_mp_alloc, v->_mp_alloc);
- //MPN_PTR_SWAP (u->_mp_d, u->_mp_size, v->_mp_d, v->_mp_size);
-
mpz_t temp;
mpz_init(temp);