diff --git a/src/lisp.h b/src/lisp.h index ee50cc777c6..a5082146da7 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -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