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

From: Eli Zaretskii <[email-masked]>
Date: Sun, 05 Jan 2025 20:42:37 +0200

> From: Gerd Möllmann <[email-masked]>
> Cc: [email-masked],  [email-masked]
> Date: Sun, 05 Jan 2025 18:49:56 +0100
> 
> Eli Zaretskii <[email-masked]> writes:
> 
> > This surprises me because on the master branch SAFE_ALLOCA_LISP either
> > calls alloca or xzalloc.  So I don't see why SAFE_ALLOCA_LISP would be
> > safer in the old GC than SAFE_NALLOCA.  It's only on the igc branch
> > that you made SAFE_ALLOCA_LISP make a Lisp vector.
> > But this is a tangent from my POV.  I would like to discuss the new
> > GC, not the old one.
> >
> 
> This in SAFE_ALLOCA_LISP_EXTRA
> 
> 	(buf) = xzalloc (alloca_nbytes);		       \
> 	record_unwind_protect_array (buf, nelt);	       \
> 
> makes a specpdl entry, which makes mark_specpdl do this:
> 
> 	case SPECPDL_UNWIND_ARRAY:
> 	  mark_objects (pdl->unwind_array.array, pdl->unwind_array.nelts);
> 	  break;

Thanks.  I guess it's supposed to be "common knowledge" that
record_unwind_protect_* indirectly causes the objects to be marked...

But then why don't we set the .mark member in SAFE_NALLOCA or some
variant thereof?