aboutsummaryrefslogtreecommitdiffstats
path: root/src/editfns.c
diff options
context:
space:
mode:
authorPaul Eggert2011-05-30 09:47:35 -0700
committerPaul Eggert2011-05-30 09:47:35 -0700
commit531b01656f89e093b9fa35959fa41e534b025320 (patch)
tree190b5a279e0e8e0130b6ba070fa217ce1282e2f3 /src/editfns.c
parentde677ace77fa48962be80b668662a7009498e5d6 (diff)
downloademacs-531b01656f89e093b9fa35959fa41e534b025320.tar.gz
emacs-531b01656f89e093b9fa35959fa41e534b025320.zip
[ChangeLog]
Malloc failure behavior now depends on size of allocation. * lib/allocator.h (struct allocator.die): New size arg. * lib/careadlinkat.c (careadlinkat): Pass size to 'die' function. If the actual problem is an ssize_t limitation, not a size_t or malloc failure, fail with errno == ENAMETOOLONG instead of calling 'die'. [src/ChangeLog] Malloc failure behavior now depends on size of allocation. * alloc.c (buffer_memory_full, memory_full): New arg NBYTES. * lisp.h: Change signatures accordingly. * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c: All callers changed.
Diffstat (limited to 'src/editfns.c')
-rw-r--r--src/editfns.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/editfns.c b/src/editfns.c
index 8b48355fbfa..0e40fde9ca4 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -3636,7 +3636,7 @@ usage: (format STRING &rest OBJECTS) */)
3636 { 3636 {
3637 EMACS_INT i; 3637 EMACS_INT i;
3638 if ((SIZE_MAX - formatlen) / sizeof (struct info) <= nargs) 3638 if ((SIZE_MAX - formatlen) / sizeof (struct info) <= nargs)
3639 memory_full (); 3639 memory_full (SIZE_MAX);
3640 SAFE_ALLOCA (info, struct info *, (nargs + 1) * sizeof *info + formatlen); 3640 SAFE_ALLOCA (info, struct info *, (nargs + 1) * sizeof *info + formatlen);
3641 discarded = (char *) &info[nargs + 1]; 3641 discarded = (char *) &info[nargs + 1];
3642 for (i = 0; i < nargs + 1; i++) 3642 for (i = 0; i < nargs + 1; i++)