Remove SAFE_ALLOCA_LISP_EXTRA

* src/lisp.h (SAFE_ALLOCA_LISP_EXTRA): Remove.  It is no longer
used, it makes life more difficult in the feature/igc3 branch,
and having it around tempted me to start using it again.
This commit is contained in:
Paul Eggert 2026-05-17 10:05:11 -07:00
parent 24f9e6a693
commit 7626993c6f

View file

@ -5608,7 +5608,7 @@ extern void init_system_name (void);
systems to detect stack exhaustion and enlarge the stack as
needed; this thus risks hitting a segfault where none should
have happened. (This problem is real in deeply-recursive cases,
but these do happen in Emacs, e.g. in regexp search or during GC.) */
e.g., in regexp search or during GC.) */
enum MAX_ALLOCA { MAX_ALLOCA = 16 * 1024 };
@ -5697,32 +5697,23 @@ safe_free_unbind_to (specpdl_ref count, specpdl_ref sa_count, Lisp_Object val)
# pragma GCC diagnostic ignored "-Wanalyzer-allocation-size"
#endif
/* Set BUF to point to an allocated array of NELT Lisp_Objects,
immediately followed by EXTRA spare bytes. */
/* Set BUF to point to an allocated array of NELT Lisp_Objects. */
#define SAFE_ALLOCA_LISP_EXTRA(buf, nelt, extra) \
#define SAFE_ALLOCA_LISP(buf, nelt) \
do { \
ptrdiff_t alloca_nbytes; \
if (ckd_mul (&alloca_nbytes, nelt, word_size) \
|| ckd_add (&alloca_nbytes, alloca_nbytes, extra) \
|| SIZE_MAX < alloca_nbytes) \
memory_full (SIZE_MAX); \
else if (alloca_nbytes <= sa_avail) \
(buf) = AVAIL_ALLOCA (alloca_nbytes); \
else \
{ \
/* Although only the first nelt words need clearing, \
typically EXTRA is 0 or small so just use xzalloc; \
this is simpler and often faster. */ \
(buf) = xzalloc (alloca_nbytes); \
record_unwind_protect_array (buf, nelt); \
} \
} while (false)
/* Set BUF to point to an allocated array of NELT Lisp_Objects. */
#define SAFE_ALLOCA_LISP(buf, nelt) SAFE_ALLOCA_LISP_EXTRA (buf, nelt, 0)
/* If USE_STACK_LISP_OBJECTS, define macros and functions that
allocate some Lisp objects on the C stack. As the storage is not