Subject: bug#75322: SAFE_ALLOCA assumed to root Lisp_Objects/SSDATA(string)

From: Eli Zaretskii <[email-masked]>
Date: Sun, 05 Jan 2025 13:29:34 +0200

> From: Gerd Möllmann <[email-masked]>
> Cc: [email-masked],  [email-masked]
> Date: Sun, 05 Jan 2025 11:30:11 +0100
> 
> Eli Zaretskii <[email-masked]> writes:
> 
> >> Cc: [email-masked]
> >> From: Gerd Möllmann <[email-masked]>
> >> Date: Sun, 05 Jan 2025 07:59:32 +0100
> >> 
> >> Gerd Möllmann <[email-masked]> writes:
> >> 
> >> > Just want to add that all SAFE_NALLOC uses should be checked in
> >> > scratch/igc. For example, set_overlays_multibyte uses it to store
> >> > itree_node *, and itree_node is in MPS.
> >> >
> >> > I think I'll just make it allocate a root in my Emacs. That's the least
> >> > work.
> >> 
> >> Please find attached what I'm using now in my Emacs, in addition to your
> >> xstrdup commit.
> >
> > These two are alternatives, right?  IOW, we should use one or the
> > other in each specific case, is that correct?
> 
> 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?