unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: Andy Moreton <andrewjmoreton@gmail.com>, emacs-devel@gnu.org
Cc: Tom Tromey <tom@tromey.com>
Subject: Re: Bignum speedup patch causes crash at startup
Date: Tue, 4 Sep 2018 14:11:06 -0700	[thread overview]
Message-ID: <8c20c37f-983b-08e6-177f-9223f33914fc@cs.ucla.edu> (raw)
In-Reply-To: <86lg8hf3dy.fsf@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 283 bytes --]

Andy Moreton wrote:
> Tom added support in commit fb26c9fd69 ("Make purecopy work for
> bignums"), so if that causes problems then it may need to be revisited.

That code is never used and it wouldn't hurt to remove it as per the attached. 
I'll CC: Tom to see if he has an opinion.

[-- Attachment #2: emacs-bignum.diff --]
[-- Type: text/x-patch, Size: 1281 bytes --]

diff --git a/src/alloc.c b/src/alloc.c
index 28ca7804ee..a20991e4b9 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -5325,33 +5325,6 @@ make_pure_float (double num)
   return new;
 }
 
-/* Value is a bignum object with value VALUE allocated from pure
-   space.  */
-
-static Lisp_Object
-make_pure_bignum (struct Lisp_Bignum *value)
-{
-  size_t i, nlimbs = mpz_size (value->value);
-  size_t nbytes = nlimbs * sizeof (mp_limb_t);
-  mp_limb_t *pure_limbs;
-  mp_size_t new_size;
-
-  struct Lisp_Bignum *b = pure_alloc (sizeof *b, Lisp_Vectorlike);
-  XSETPVECTYPESIZE (b, PVEC_BIGNUM, 0, VECSIZE (struct Lisp_Bignum));
-
-  pure_limbs = pure_alloc (nbytes, -1);
-  for (i = 0; i < nlimbs; ++i)
-    pure_limbs[i] = mpz_getlimbn (value->value, i);
-
-  new_size = nlimbs;
-  if (mpz_sgn (value->value) < 0)
-    new_size = -new_size;
-
-  mpz_roinit_n (b->value, pure_limbs, new_size);
-
-  return make_lisp_ptr (b, Lisp_Vectorlike);
-}
-
 /* Return a vector with room for LEN Lisp_Objects allocated from
    pure space.  */
 
@@ -5492,8 +5465,6 @@ purecopy (Lisp_Object obj)
       /* Don't hash-cons it.  */
       return obj;
     }
-  else if (BIGNUMP (obj))
-    obj = make_pure_bignum (XBIGNUM (obj));
   else
     {
       AUTO_STRING (fmt, "Don't know how to purify: %S");

  reply	other threads:[~2018-09-04 21:11 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-04 14:21 Bignum speedup patch causes crash at startup Andy Moreton
2018-09-04 15:10 ` Eli Zaretskii
2018-09-04 16:24   ` Eli Zaretskii
2018-09-04 18:59     ` Paul Eggert
2018-09-05  2:35       ` Eli Zaretskii
2018-09-05  7:31         ` Paul Eggert
2018-09-04 16:40 ` Paul Eggert
2018-09-04 17:30   ` Eli Zaretskii
2018-09-04 17:37   ` Andy Moreton
2018-09-04 17:50     ` Eli Zaretskii
2018-09-04 19:50       ` Andy Moreton
2018-09-04 21:11         ` Paul Eggert [this message]
2018-09-04 22:34           ` Tom Tromey
2018-09-05  0:09             ` Andy Moreton
2018-09-05  0:56               ` Paul Eggert
2018-09-05 15:21                 ` Eli Zaretskii
2018-09-05 15:17         ` Eli Zaretskii
2018-09-04 19:56     ` Andy Moreton
2018-09-04 20:48       ` Paul Eggert
2018-09-05 15:15         ` Eli Zaretskii
2018-09-05 15:40           ` Paul Eggert
2018-09-05 15:50             ` Pip Cet
2018-09-05 16:06               ` Paul Eggert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8c20c37f-983b-08e6-177f-9223f33914fc@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=andrewjmoreton@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=tom@tromey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).