]> git.eshelyaron.com Git - emacs.git/commitdiff
Avoid some make_formatted_string mallocs
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 28 Jan 2025 01:15:47 +0000 (17:15 -0800)
committerEshel Yaron <me@eshelyaron.com>
Thu, 30 Jan 2025 18:08:52 +0000 (19:08 +0100)
* src/alloc.c (make_formatted_string):
Grow the local buffer from 64 to MAX_ALLOCA bytes.

(cherry picked from commit 1f1088188e8b9319f60141a093431f1f85c2b03c)

src/alloc.c

index 2c0ccc9dd62868b1079c4ae9ddff9922323b99e1..b13c3e49224fe73fa90852a5278edab801e66f09 100644 (file)
@@ -2547,7 +2547,7 @@ make_uninit_multibyte_string (EMACS_INT nchars, EMACS_INT nbytes)
 Lisp_Object
 make_formatted_string (const char *format, ...)
 {
-  char buf[64];
+  char buf[MAX_ALLOCA];
   char *cstr = buf;
   ptrdiff_t bufsize = sizeof buf;
   va_list ap;