GNU bug report logs - #75322
SAFE_ALLOCA assumed to root Lisp_Objects/SSDATA(string)

Previous Next

Package: emacs;

Reported by: Pip Cet <pipcet <at> protonmail.com>

Date: Fri, 3 Jan 2025 17:21:02 UTC

Severity: normal

Full log


Message #152 received at 75322 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Gerd Möllmann <gerd.moellmann <at> gmail.com>
Cc: pipcet <at> protonmail.com, 75322 <at> debbugs.gnu.org
Subject: Re: bug#75322: SAFE_ALLOCA assumed to root Lisp_Objects/SSDATA(string)
Date: Sun, 05 Jan 2025 14:15:13 +0200
> From: Gerd Möllmann <gerd.moellmann <at> gmail.com>
> Cc: pipcet <at> protonmail.com,  75322 <at> debbugs.gnu.org
> Date: Sun, 05 Jan 2025 12:37:42 +0100
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> >> If you mean the two patches I sent with "these two", then no. I prefer
> >> using SAFE_ALLOCA_LISP because that introduces an exact root.
> >
> > I guess I'm confused, then.  The first patch replaces calls to
> > SAFE_NALLOCA by SAFE_ALLOCA_LISP, the second patch modifies
> > SAFE_NALLOCA to call igc_xnmalloc_ambig.  That's why I thought they
> > were alternatives.
> >
> > If they are not alternatives, then why did you replace SAFE_NALLOCA in
> > the first patch?
> 
> I checked other uses of SAFE_NALLOCA that were not yet mentioned, and
> found another problematic case. (Something with struct itree_node *,
> don't remember the function name, it's in some other mail). There were
> too many grep hits for SAFE_NALLOCA for me, so I shot with a canon :-).

OK.

So can we talk about the relative merits and demerits of using
SAFE_ALLOCA_LISP vs SAFE_NALLOCA?  First, why is it better to have an
exact root than an ambiguous root?  And second, SAFE_ALLOCA_LISP
conses a Lisp vector, which will increase GC pressure, so isn't
SAFE_NALLOCA preferable at least in some cases?




This bug report was last modified 146 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.