Problem reported by Andy Moreton in:
https://lists.gnu.org/r/emacs-devel/2018-09/msg00072.html
and crystal-ball diagnosis by Eli Zaretskii in:
https://lists.gnu.org/r/emacs-devel/2018-09/msg00075.html
* src/alloc.c (xrealloc_for_gmp, xfree_for_gmp): Move to bignum.c.
(init_alloc): Move bignum initialization to init_bignum.
* src/bignum.c (init_bignum): Rename from init_bignum_once.
All users changed.
* src/emacs.c (main): Call init_bignum after init_alloc,
instead of calling init_bignum_once after init_bignum.
xsignal0 (Qrange_error);
}
-static void *
-xrealloc_for_gmp (void *ptr, size_t ignore, size_t size)
-{
- return xrealloc (ptr, size);
-}
-
-static void
-xfree_for_gmp (void *ptr, size_t ignore)
-{
- xfree (ptr);
-}
-
/* Initialization. */
void
void
init_alloc (void)
{
- eassert (mp_bits_per_limb == GMP_NUMB_BITS);
- integer_width = 1 << 16;
- mp_set_memory_functions (xmalloc, xrealloc_for_gmp, xfree_for_gmp);
-
Vgc_elapsed = make_float (0.0);
gcs_done = 0;
mpz_t mpz[4];
+static void *
+xrealloc_for_gmp (void *ptr, size_t ignore, size_t size)
+{
+ return xrealloc (ptr, size);
+}
+
+static void
+xfree_for_gmp (void *ptr, size_t ignore)
+{
+ xfree (ptr);
+}
+
void
-init_bignum_once (void)
+init_bignum (void)
{
+ eassert (mp_bits_per_limb == GMP_NUMB_BITS);
+ integer_width = 1 << 16;
+ mp_set_memory_functions (xmalloc, xrealloc_for_gmp, xfree_for_gmp);
+
for (int i = 0; i < ARRAYELTS (mpz); i++)
mpz_init (mpz[i]);
}
extern mpz_t mpz[4];
-extern void init_bignum_once (void);
+extern void init_bignum (void);
extern Lisp_Object make_integer_mpz (void);
extern void mpz_set_intmax_slow (mpz_t, intmax_t) ARG_NONNULL ((1));
if (!initialized)
{
init_alloc_once ();
- init_bignum_once ();
init_threads_once ();
init_obarray ();
init_eval_once ();
}
init_alloc ();
+ init_bignum ();
init_threads ();
if (do_initial_setlocale)