aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/alloc.c10
-rw-r--r--src/buffer.c2
-rw-r--r--src/ccl.c2
-rw-r--r--src/charset.c2
-rw-r--r--src/coding.c2
-rw-r--r--src/composite.c2
-rw-r--r--src/doc.c2
-rw-r--r--src/doprnt.c2
-rw-r--r--src/editfns.c2
-rw-r--r--src/emacs.c4
-rw-r--r--src/fns.c2
-rw-r--r--src/ftfont.c2
-rw-r--r--src/gtkutil.c2
-rw-r--r--src/image.c15
-rw-r--r--src/keyboard.c2
-rw-r--r--src/lread.c4
-rw-r--r--src/minibuf.c2
-rw-r--r--src/print.c2
-rw-r--r--src/search.c4
-rw-r--r--src/termcap.c8
-rw-r--r--src/tparam.c2
-rw-r--r--src/xdisp.c2
-rw-r--r--src/xfns.c12
-rw-r--r--src/xrdb.c6
-rw-r--r--src/xselect.c4
-rw-r--r--src/xsmfns.c6
-rw-r--r--src/xterm.c4
27 files changed, 55 insertions, 54 deletions
diff --git a/src/alloc.c b/src/alloc.c
index 366fd3448a..51ab850f7e 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -386,7 +386,7 @@ xstrdup (const char *s)
ptrdiff_t size;
eassert (s);
size = strlen (s) + 1;
- return memcpy (xmalloc (size), s, size);
+ return memcpy (xmalloc_atomic (size), s, size);
}
/* Like above, but duplicates Lisp string to C string. */
@@ -395,7 +395,7 @@ char *
xlispstrdup (Lisp_Object string)
{
ptrdiff_t size = SBYTES (string) + 1;
- return memcpy (xmalloc (size), SSDATA (string), size);
+ return memcpy (xmalloc_atomic (size), SSDATA (string), size);
}
/* Assign to *PTR a copy of STRING, freeing any storage *PTR formerly
@@ -787,7 +787,7 @@ Lisp_Object
make_float (double float_value)
{
register Lisp_Object val;
- XSETFLOAT (val, xmalloc (sizeof (struct Lisp_Float)));
+ XSETFLOAT (val, xmalloc_atomic (sizeof (struct Lisp_Float)));
XFLOAT_INIT (val, float_value);
return val;
}
@@ -1459,7 +1459,7 @@ memory_full (size_t nbytes)
bool enough_free_memory = 0;
if (SPARE_MEMORY < nbytes)
{
- void *p = xmalloc_unsafe (SPARE_MEMORY);
+ void *p = xmalloc_atomic_unsafe (SPARE_MEMORY);
if (p)
{
xfree (p);
@@ -1495,7 +1495,7 @@ void
refill_memory_reserve (void)
{
if (spare_memory == NULL)
- spare_memory = xmalloc_unsafe (SPARE_MEMORY);
+ spare_memory = xmalloc_atomic_unsafe (SPARE_MEMORY);
if (spare_memory)
Vmemory_full = Qnil;
diff --git a/src/buffer.c b/src/buffer.c
index d6f6b2c770..2ec2061743 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -5010,7 +5010,7 @@ alloc_buffer_text (struct buffer *b, ptrdiff_t nbytes)
#elif defined REL_ALLOC
p = r_alloc ((void **) &b->text->beg, nbytes);
#else
- p = xmalloc (nbytes);
+ p = xmalloc_atomic (nbytes);
#endif
if (p == NULL)
diff --git a/src/ccl.c b/src/ccl.c
index 54093bf567..6dedaf68cb 100644
--- a/src/ccl.c
+++ b/src/ccl.c
@@ -2092,7 +2092,7 @@ usage: (ccl-execute-on-string CCL-PROGRAM STATUS STRING &optional CONTINUE UNIBY
outbufsize = (ccl.buf_magnification
? str_bytes * ccl.buf_magnification + 256
: str_bytes + 256);
- outp = outbuf = xmalloc (outbufsize);
+ outp = outbuf = xmalloc_atomic (outbufsize);
consumed_chars = consumed_bytes = 0;
produced_chars = 0;
diff --git a/src/charset.c b/src/charset.c
index 341ac356af..57437b8bf3 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -914,7 +914,7 @@ usage: (define-charset-internal ...) */)
if (! charset.code_linear_p)
{
- charset.code_space_mask = xzalloc (256);
+ charset.code_space_mask = xzalloc_atomic (256);
for (i = 0; i < 4; i++)
for (j = charset.code_space[i * 4]; j <= charset.code_space[i * 4 + 1];
j++)
diff --git a/src/coding.c b/src/coding.c
index 5dbaf96840..3fffeb49c5 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -8342,7 +8342,7 @@ encode_coding_object (struct coding_system *coding,
{
ptrdiff_t dst_bytes = max (1, coding->src_chars);
coding->dst_object = Qnil;
- coding->destination = xmalloc (dst_bytes);
+ coding->destination = xmalloc_atomic (dst_bytes);
coding->dst_bytes = dst_bytes;
coding->dst_multibyte = 0;
}
diff --git a/src/composite.c b/src/composite.c
index 66a20759ec..3dc715ebf6 100644
--- a/src/composite.c
+++ b/src/composite.c
@@ -327,7 +327,7 @@ get_composition_id (ptrdiff_t charpos, ptrdiff_t bytepos, ptrdiff_t nchars,
cmp->method = method;
cmp->hash_index = hash_index;
cmp->glyph_len = glyph_len;
- cmp->offsets = xnmalloc (glyph_len, 2 * sizeof *cmp->offsets);
+ cmp->offsets = xnmalloc_atomic (glyph_len, 2 * sizeof *cmp->offsets);
cmp->font = NULL;
if (cmp->method != COMPOSITION_WITH_RULE_ALTCHARS)
diff --git a/src/doc.c b/src/doc.c
index df8cfba3f2..d0b28f8cad 100644
--- a/src/doc.c
+++ b/src/doc.c
@@ -747,7 +747,7 @@ Otherwise, return a new string. */)
keymap = Voverriding_local_map;
bsize = SBYTES (string);
- bufp = buf = xmalloc (bsize);
+ bufp = buf = xmalloc_atomic (bsize);
strp = SDATA (string);
while (strp < SDATA (string) + SBYTES (string))
diff --git a/src/doprnt.c b/src/doprnt.c
index cc4d0e4677..3d50724ae2 100644
--- a/src/doprnt.c
+++ b/src/doprnt.c
@@ -250,7 +250,7 @@ doprnt (char *buffer, ptrdiff_t bufsize, const char *format,
{
if (big_buffer)
xfree (big_buffer);
- big_buffer = xmalloc (size_bound);
+ big_buffer = xmalloc_atomic (size_bound);
sprintf_buffer = big_buffer;
size_allocated = size_bound;
}
diff --git a/src/editfns.c b/src/editfns.c
index 5bef151a5b..8308d07408 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -4209,7 +4209,7 @@ usage: (format STRING &rest OBJECTS) */)
if (buf == initial_buffer)
{
- buf = xmalloc (bufsize);
+ buf = xmalloc_atomic (bufsize);
sa_must_free = true;
buf_save_value_index = SPECPDL_INDEX ();
record_unwind_protect_ptr (xfree, buf);
diff --git a/src/emacs.c b/src/emacs.c
index a79c68af59..ad7442b0c5 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -1779,8 +1779,8 @@ sort_args (int argc, char **argv)
0 for an option that takes no arguments,
1 for an option that takes one argument, etc.
-1 for an ordinary non-option argument. */
- int *options = xnmalloc (argc, sizeof *options);
- int *priority = xnmalloc (argc, sizeof *priority);
+ int *options = xnmalloc_atomic (argc, sizeof *options);
+ int *priority = xnmalloc_atomic (argc, sizeof *priority);
int to = 1;
int incoming_used = 1;
int from;
diff --git a/src/fns.c b/src/fns.c
index a355dab8bf..fd1568b804 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -1054,7 +1054,7 @@ an error is signaled. */)
if (STRING_MULTIBYTE (string))
{
ptrdiff_t chars = SCHARS (string);
- unsigned char *str = xmalloc (chars);
+ unsigned char *str = xmalloc_atomic (chars);
ptrdiff_t converted = str_to_unibyte (SDATA (string), str, chars);
if (converted < chars)
diff --git a/src/ftfont.c b/src/ftfont.c
index f87d759234..bea1e01d1f 100644
--- a/src/ftfont.c
+++ b/src/ftfont.c
@@ -693,7 +693,7 @@ ftfont_get_open_type_spec (Lisp_Object otf_spec)
spec->features[i] =
(min (PTRDIFF_MAX, SIZE_MAX) / sizeof (int) < XINT (len)
? 0
- : xmalloc_unsafe (XINT (len) * sizeof *spec->features[i]));
+ : xmalloc_atomic_unsafe (XINT (len) * sizeof *spec->features[i]));
if (! spec->features[i])
{
if (i > 0 && spec->features[0])
diff --git a/src/gtkutil.c b/src/gtkutil.c
index e3d4406725..558b727110 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -498,7 +498,7 @@ get_utf8_string (const char *str)
len = strlen (str);
if ((min (PTRDIFF_MAX, SIZE_MAX) - len - 1) / 4 < nr_bad)
memory_full (SIZE_MAX);
- up = utf8_str = xmalloc (len + nr_bad * 4 + 1);
+ up = utf8_str = xmalloc_atomic (len + nr_bad * 4 + 1);
p = (unsigned char *)str;
while (! (cp = g_locale_to_utf8 ((char *)p, -1, &bytes_read,
diff --git a/src/image.c b/src/image.c
index 24e1f3b286..60caf84b7d 100644
--- a/src/image.c
+++ b/src/image.c
@@ -1920,7 +1920,7 @@ x_create_x_image_and_pixmap (struct frame *f, int width, int height, int depth,
}
/* Allocate image raster. */
- (*ximg)->data = xmalloc ((*ximg)->bytes_per_line * height);
+ (*ximg)->data = xmalloc_atomic ((*ximg)->bytes_per_line * height);
/* Allocate a pixmap of the same size. */
*pixmap = XCreatePixmap (display, window, width, height, depth);
@@ -2788,7 +2788,7 @@ xbm_read_bitmap_data (struct frame *f, unsigned char *contents, unsigned char *e
}
bytes_per_line = (*width + 7) / 8 + padding_p;
nbytes = bytes_per_line * *height;
- p = *data = xmalloc (nbytes);
+ p = *data = xmalloc_atomic (nbytes);
if (v10)
{
@@ -3687,7 +3687,8 @@ xpm_load (struct frame *f, struct image *img)
#endif /* HAVE_NTGUI */
/* Remember allocated colors. */
- img->colors = xnmalloc (attrs.nalloc_pixels, sizeof *img->colors);
+ img->colors = xnmalloc_atomic (attrs.nalloc_pixels,
+ sizeof *img->colors);
img->ncolors = attrs.nalloc_pixels;
for (i = 0; i < attrs.nalloc_pixels; ++i)
{
@@ -4482,7 +4483,7 @@ colors_in_color_table (int *n)
}
else
{
- colors = xmalloc (ct_colors_allocated * sizeof *colors);
+ colors = xmalloc_atomic (ct_colors_allocated * sizeof *colors);
*n = ct_colors_allocated;
for (i = j = 0; i < CT_SIZE; ++i)
@@ -5911,8 +5912,8 @@ png_load_body (struct frame *f, struct image *img, struct png_load_context *c)
if (min (PTRDIFF_MAX, SIZE_MAX) / sizeof *rows < height
|| min (PTRDIFF_MAX, SIZE_MAX) / sizeof *pixels / height < row_bytes)
memory_full (SIZE_MAX);
- c->pixels = pixels = xmalloc (sizeof *pixels * row_bytes * height);
- c->rows = rows = xmalloc (height * sizeof *rows);
+ c->pixels = pixels = xmalloc_atomic (sizeof *pixels * row_bytes * height);
+ c->rows = rows = xmalloc_atomic (height * sizeof *rows);
for (i = 0; i < height; ++i)
rows[i] = pixels + i * row_bytes;
@@ -7013,7 +7014,7 @@ tiff_load (struct frame *f, struct image *img)
return 0;
}
- buf = xmalloc (sizeof *buf * width * height);
+ buf = xmalloc_atomic (sizeof *buf * width * height);
rc = fn_TIFFReadRGBAImage (tiff, width, height, buf, 0);
diff --git a/src/keyboard.c b/src/keyboard.c
index cc578c5d56..1deca7e5a2 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -8251,7 +8251,7 @@ parse_tool_bar_item (Lisp_Object key, Lisp_Object item)
const char *capt = STRINGP (tcapt) ? SSDATA (tcapt) : "";
ptrdiff_t max_lbl =
2 * max (0, min (tool_bar_max_label_size, STRING_BYTES_BOUND / 2));
- char *buf = xmalloc (max_lbl + 1);
+ char *buf = xmalloc_atomic (max_lbl + 1);
Lisp_Object new_lbl;
ptrdiff_t caption_len = strlen (capt);
diff --git a/src/lread.c b/src/lread.c
index ed844a7e7a..5cf5553eca 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -2778,7 +2778,7 @@ read1 (Lisp_Object readcharfun, int *pch, bool first_in_list)
if (saved_doc_string_size == 0)
{
- saved_doc_string = xmalloc (nskip + extra);
+ saved_doc_string = xmalloc_atomic (nskip + extra);
saved_doc_string_size = nskip + extra;
}
if (nskip > saved_doc_string_size)
@@ -4079,7 +4079,7 @@ init_obarray (void)
DEFSYM (Qvariable_documentation, "variable-documentation");
- read_buffer = xmalloc (size);
+ read_buffer = xmalloc_atomic (size);
read_buffer_size = size;
}
diff --git a/src/minibuf.c b/src/minibuf.c
index 3042b13b7d..6f7a103092 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -231,7 +231,7 @@ read_minibuf_noninteractive (Lisp_Object map, Lisp_Object initial,
val = Qnil;
size = 100;
len = 0;
- line = xmalloc (size);
+ line = xmalloc_atomic (size);
while ((c = getchar ()) != '\n')
{
diff --git a/src/print.c b/src/print.c
index 66976cfc7c..885394c1b6 100644
--- a/src/print.c
+++ b/src/print.c
@@ -153,7 +153,7 @@ bool print_output_debug_flag EXTERNALLY_VISIBLE = 1;
else \
{ \
int new_size = 1000; \
- print_buffer = xmalloc (new_size); \
+ print_buffer = xmalloc_atomic (new_size); \
print_buffer_size = new_size; \
free_print_buffer = 1; \
} \
diff --git a/src/search.c b/src/search.c
index ecfb235214..55afb849e8 100644
--- a/src/search.c
+++ b/src/search.c
@@ -2578,7 +2578,7 @@ since only regular expressions have distinguished subexpressions. */)
substed_alloc_size = (length <= (STRING_BYTES_BOUND - 100) / 2
? length * 2 + 100
: STRING_BYTES_BOUND);
- substed = xmalloc (substed_alloc_size);
+ substed = xmalloc_atomic (substed_alloc_size);
substed_len = 0;
/* Go thru NEWTEXT, producing the actual text to insert in
@@ -3288,7 +3288,7 @@ syms_of_search (void)
for (i = 0; i < REGEXP_CACHE_SIZE; ++i)
{
searchbufs[i].buf.allocated = 100;
- searchbufs[i].buf.buffer = xmalloc (100);
+ searchbufs[i].buf.buffer = xmalloc_atomic (100);
searchbufs[i].buf.fastmap = searchbufs[i].fastmap;
searchbufs[i].regexp = Qnil;
searchbufs[i].whitespace_regexp = Qnil;
diff --git a/src/termcap.c b/src/termcap.c
index 8c766bd199..702d30bb70 100644
--- a/src/termcap.c
+++ b/src/termcap.c
@@ -150,7 +150,7 @@ tgetst1 (char *ptr, char **area)
p = ptr;
while ((c = *p++) && c != ':' && c != '\n')
;
- ret = xmalloc (p - ptr + 1);
+ ret = xmalloc_atomic (p - ptr + 1);
}
else
ret = *area;
@@ -374,7 +374,7 @@ tgetent (char *bp, const char *name)
if (!bp)
{
malloc_size = 1 + strlen (term);
- bp = xmalloc (malloc_size);
+ bp = xmalloc_atomic (malloc_size);
}
strcpy (bp, term);
goto ret;
@@ -433,13 +433,13 @@ tgetent (char *bp, const char *name)
buf.size = BUFSIZE;
/* Add 1 to size to ensure room for terminating null. */
- buf.beg = xmalloc (buf.size + 1);
+ buf.beg = xmalloc_atomic (buf.size + 1);
term = indirect ? indirect : (char *)name;
if (!bp)
{
malloc_size = indirect ? strlen (tcenv) + 1 : buf.size;
- bp = xmalloc (malloc_size);
+ bp = xmalloc_atomic (malloc_size);
}
tc_search_point = bp1 = bp;
diff --git a/src/tparam.c b/src/tparam.c
index e02cea3689..2c72db3dfa 100644
--- a/src/tparam.c
+++ b/src/tparam.c
@@ -96,7 +96,7 @@ tparam1 (const char *string, char *outstring, int len,
if (outlen == 0)
{
outlen = len + 40;
- new = xmalloc (outlen);
+ new = xmalloc_atomic (outlen);
memcpy (new, outstring, offset);
}
else
diff --git a/src/xdisp.c b/src/xdisp.c
index 5ac3c50c50..76ffdb4d1d 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -30641,7 +30641,7 @@ init_xdisp (void)
/* Allocate the buffer for frame titles.
Also used for `format-mode-line'. */
int size = 100;
- mode_line_noprop_buf = xmalloc (size);
+ mode_line_noprop_buf = xmalloc_atomic (size);
mode_line_noprop_buf_end = mode_line_noprop_buf + size;
mode_line_noprop_ptr = mode_line_noprop_buf;
mode_line_target = MODE_LINE_DISPLAY;
diff --git a/src/xfns.c b/src/xfns.c
index 651d21294e..e8e3fbe1a1 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -1283,7 +1283,7 @@ x_encode_text (Lisp_Object string, Lisp_Object coding_system, int selectionp,
coding.mode |= (CODING_MODE_SAFE_ENCODING | CODING_MODE_LAST_BLOCK);
/* We suppress producing escape sequences for composition. */
coding.common_flags &= ~CODING_ANNOTATION_MASK;
- coding.destination = xnmalloc (SCHARS (string), 2);
+ coding.destination = xnmalloc_atomic (SCHARS (string), 2);
coding.dst_bytes = SCHARS (string) * 2;
encode_coding_object (&coding, string, 0, 0,
SCHARS (string), SBYTES (string), Qnil);
@@ -1681,7 +1681,7 @@ xic_create_fontsetname (const char *base_fontname, int motif)
if (xic_default_fontset == base_fontname)
{
/* There is no base font name, use the default. */
- fontsetname = xmalloc (strlen (base_fontname) + 2);
+ fontsetname = xmalloc_atomic (strlen (base_fontname) + 2);
strcpy (fontsetname, base_fontname);
}
else
@@ -1701,8 +1701,8 @@ xic_create_fontsetname (const char *base_fontname, int motif)
/* As the font name doesn't conform to XLFD, we can't
modify it to generalize it to allcs and allfamilies.
Use the specified font plus the default. */
- fontsetname = xmalloc (strlen (base_fontname)
- + strlen (xic_default_fontset) + 3);
+ fontsetname = xmalloc_atomic (strlen (base_fontname)
+ + strlen (xic_default_fontset) + 3);
strcpy (fontsetname, base_fontname);
strcat (fontsetname, sep);
strcat (fontsetname, xic_default_fontset);
@@ -1774,7 +1774,7 @@ xic_create_fontsetname (const char *base_fontname, int motif)
/* Build the actual font set name. */
len = strlen (base_fontname) + strlen (font_allcs)
+ strlen (font_allfamilies) + strlen (font_all) + 5;
- fontsetname = xmalloc (len);
+ fontsetname = xmalloc_atomic (len);
strcpy (fontsetname, base_fontname);
strcat (fontsetname, sep);
strcat (fontsetname, font_allcs);
@@ -4525,7 +4525,7 @@ FRAME. Default is to change on the edit X window. */)
This applies even if long is more than 32 bits. The X library
converts to 32 bits before sending to the X server. */
elsize = element_format == 32 ? sizeof (long) : element_format >> 3;
- data = xnmalloc (nelements, elsize);
+ data = xnmalloc_atomic (nelements, elsize);
x_fill_property_data (FRAME_X_DISPLAY (f), value, data, element_format);
}
diff --git a/src/xrdb.c b/src/xrdb.c
index 107a8fca4e..589856d6ee 100644
--- a/src/xrdb.c
+++ b/src/xrdb.c
@@ -111,7 +111,7 @@ magic_db (const char *string, ptrdiff_t string_len, const char *class,
char *lang = getenv ("LANG");
ptrdiff_t path_size = 100;
- char *path = xmalloc (path_size);
+ char *path = xmalloc_atomic (path_size);
ptrdiff_t path_len = 0;
const char *p = string;
@@ -232,7 +232,7 @@ gethomedir (void)
if (ptr == NULL)
return xstrdup ("/");
- copy = xmalloc (strlen (ptr) + 2);
+ copy = xmalloc_atomic (strlen (ptr) + 2);
strcpy (copy, ptr);
return strcat (copy, "/");
}
@@ -355,7 +355,7 @@ get_user_db (Display *display)
char *xdefault;
home = gethomedir ();
- xdefault = xmalloc (strlen (home) + sizeof ".Xdefaults");
+ xdefault = xmalloc_atomic (strlen (home) + sizeof (".Xdefaults"));
strcpy (xdefault, home);
strcat (xdefault, ".Xdefaults");
db = XrmGetFileDatabase (xdefault);
diff --git a/src/xselect.c b/src/xselect.c
index 93de0f5f9d..1ed552fdac 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -1299,7 +1299,7 @@ x_get_window_property (Display *display, Window window, Atom property,
if (total_size_max < bytes_remaining)
goto size_overflow;
total_size = bytes_remaining;
- data = xmalloc (total_size + 1);
+ data = xmalloc_atomic (total_size + 1);
/* Now read, until we've gotten it all. */
while (bytes_remaining)
@@ -1400,7 +1400,7 @@ receive_incremental_selection (Display *display, Window window, Atom property,
struct prop_location *wait_object;
if (min (PTRDIFF_MAX, SIZE_MAX) < min_size_bytes)
memory_full (SIZE_MAX);
- *data_ret = xmalloc (min_size_bytes);
+ *data_ret = xmalloc_atomic (min_size_bytes);
*size_bytes_ret = min_size_bytes;
TRACE1 ("Read %u bytes incrementally", min_size_bytes);
diff --git a/src/xsmfns.c b/src/xsmfns.c
index 650cfaeee8..645e19951b 100644
--- a/src/xsmfns.c
+++ b/src/xsmfns.c
@@ -229,7 +229,7 @@ smc_save_yourself_CB (SmcConn smcConn,
props[props_idx]->vals[vp_idx].length = strlen (emacs_program);
props[props_idx]->vals[vp_idx++].value = emacs_program;
- smid_opt = xmalloc (strlen (SMID_OPT) + strlen (client_id) + 1);
+ smid_opt = xmalloc_atomic (strlen (SMID_OPT) + strlen (client_id) + 1);
strcpy (smid_opt, SMID_OPT);
strcat (smid_opt, client_id);
@@ -241,7 +241,7 @@ smc_save_yourself_CB (SmcConn smcConn,
if (cwd)
{
- chdir_opt = xmalloc (strlen (CHDIR_OPT) + strlen (cwd) + 1);
+ chdir_opt = xmalloc_atomic (strlen (CHDIR_OPT) + strlen (cwd) + 1);
strcpy (chdir_opt, CHDIR_OPT);
strcat (chdir_opt, cwd);
@@ -414,7 +414,7 @@ x_session_initialize (struct x_display_info *dpyinfo)
/* This malloc will not be freed, but it is only done once, and hopefully
not very large */
- emacs_program = xmalloc (name_len + 1);
+ emacs_program = xmalloc_atomic (name_len + 1);
emacs_program[0] = '\0';
if (! EQ (Vinvocation_directory, Qnil))
diff --git a/src/xterm.c b/src/xterm.c
index 45bb7b2a91..eb33259404 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -10016,8 +10016,8 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
if (lim - SBYTES (Vinvocation_name) < SBYTES (Vsystem_name))
memory_full (SIZE_MAX);
dpyinfo->x_id = ++x_display_id;
- dpyinfo->x_id_name = xmalloc (SBYTES (Vinvocation_name)
- + SBYTES (Vsystem_name) + 2);
+ dpyinfo->x_id_name = xmalloc_atomic (SBYTES (Vinvocation_name)
+ + SBYTES (Vsystem_name) + 2);
strcat (strcat (strcpy (dpyinfo->x_id_name, SSDATA (Vinvocation_name)), "@"),
SSDATA (Vsystem_name));