From: Eli Zaretskii <eliz@gnu.org>
To: Dima Kogan <lists@dima.secretsauce.net>
Cc: schwab@suse.de, eggert@cs.ucla.edu, emacs-devel@gnu.org
Subject: Re: Debugging emacs memory management
Date: Mon, 05 Oct 2015 21:24:01 +0300 [thread overview]
Message-ID: <83y4fhxjge.fsf@gnu.org> (raw)
In-Reply-To: <877fn118m5.fsf@secretsauce.net>
> From: Dima Kogan <lists@dima.secretsauce.net>
> Cc: schwab@suse.de, eggert@cs.ucla.edu, emacs-devel@gnu.org
> Date: Mon, 05 Oct 2015 11:19:14 -0700
>
> >> > This better be always true, otherwise XCAR (XCAR (tail)) would be a bug.
> >>
> >> It isn't. Without that check I was getting every time.
> >>
> >> *ERROR*: Wrong type argument: listp, "monospace-10"
> >
> > I think what Andreas meant was this: the old code used
> > XCAR (XCAR (tail)) unconditionally, which seems to indicate that
> > XCAR (tail) is always a cons cell, and your test should always
> > yield true.
>
> I just looked at it again, and it was my mistake; this is always a cons
> cell as it should be. I was getting the error when using Fcopy_sequence
> instead of making a new cell with Fcons. The former would make a deeper
> copy, but the alist entries aren't lists, so Fcopy_sequence() was
> barfing. Making a new cons-cell is one-level deep, and it's deep-enough,
> so it works. So yeah, my bad.
>
>
> >> Surprised me too, and I haven't checked to see what was happening there.
> >
> > So maybe your code should include some check for QCfont_entity in the
> > 'else' clause as well.
>
> Here's the updated patch:
>
> diff --git a/src/font.c b/src/font.c
> index 8e06532..dd574ca 100644
> --- a/src/font.c
> +++ b/src/font.c
> @@ -3981,7 +3981,12 @@ copy_font_spec (Lisp_Object font)
> pcdr = spec->props + FONT_EXTRA_INDEX;
> for (tail = AREF (font, FONT_EXTRA_INDEX); CONSP (tail); tail = XCDR (tail))
> if (!EQ (XCAR (XCAR (tail)), QCfont_entity))
> - *pcdr = Fcons (XCAR (tail), Qnil), pcdr = xcdr_addr (*pcdr);
> + {
> + *pcdr = Fcons (Fcons( XCAR (XCAR (tail)),
> + XCDR (XCAR (tail))),
> + Qnil);
> + pcdr = xcdr_addr (*pcdr);
> + }
>
> XSETFONT (new_spec, spec);
> return new_spec;
>
> I'm not sure what you mean about checking for QCfont_entity. This new
> patch doesn't add an if(), and there's already a QCfont_entity check
> there. This is fine, right?
Forget that. It was based on your reports about errors.
next prev parent reply other threads:[~2015-10-05 18:24 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-11 6:01 Debugging emacs memory management Dima Kogan
2015-02-11 15:05 ` Stefan Monnier
2015-02-15 20:28 ` Dima Kogan
2015-02-15 20:47 ` Eli Zaretskii
2015-02-16 1:39 ` Stefan Monnier
2015-02-17 7:59 ` Dima Kogan
2015-02-17 15:59 ` Eli Zaretskii
2015-02-18 0:07 ` Stefan Monnier
2015-02-11 19:07 ` Florian Weimer
2015-09-15 19:27 ` Dima Kogan
2015-09-16 16:28 ` Paul Eggert
2015-09-20 22:01 ` Dima Kogan
2015-09-21 6:46 ` Eli Zaretskii
2015-09-21 8:54 ` Dima Kogan
2015-09-21 10:00 ` Eli Zaretskii
2015-09-21 10:21 ` Eli Zaretskii
2015-09-22 21:33 ` Dima Kogan
2015-09-23 6:35 ` Eli Zaretskii
2015-09-23 6:37 ` Dima Kogan
2015-09-23 7:16 ` Eli Zaretskii
2015-10-05 7:21 ` Dima Kogan
2015-10-05 7:55 ` Eli Zaretskii
2015-10-05 8:24 ` Dima Kogan
2015-10-05 8:33 ` Eli Zaretskii
2015-10-05 8:43 ` Eli Zaretskii
2015-10-05 9:24 ` Dima Kogan
2015-10-05 9:49 ` Dima Kogan
2015-10-05 9:58 ` Andreas Schwab
2015-10-05 10:02 ` Dima Kogan
2015-10-05 10:47 ` Eli Zaretskii
2015-10-05 18:19 ` Dima Kogan
2015-10-05 18:24 ` Eli Zaretskii [this message]
2015-10-05 23:21 ` Dima Kogan
2015-10-06 2:41 ` Eli Zaretskii
2015-10-08 21:51 ` Dima Kogan
2015-09-16 16:34 ` Davis Herring
2015-09-16 22:03 ` Markus Triska
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83y4fhxjge.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=eggert@cs.ucla.edu \
--cc=emacs-devel@gnu.org \
--cc=lists@dima.secretsauce.net \
--cc=schwab@suse.de \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.