aboutsummaryrefslogtreecommitdiffstats
path: root/src/buffer.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/buffer.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/buffer.c')
-rw-r--r--src/buffer.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/buffer.c b/src/buffer.c
index 05bd129976f..e9ff8f492ba 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -328,7 +328,7 @@ even if it is dead. The return value is never nil. */)
328 alloc_buffer_text (b, BUF_GAP_SIZE (b) + 1); 328 alloc_buffer_text (b, BUF_GAP_SIZE (b) + 1);
329 UNBLOCK_INPUT; 329 UNBLOCK_INPUT;
330 if (! BUF_BEG_ADDR (b)) 330 if (! BUF_BEG_ADDR (b))
331 buffer_memory_full (); 331 buffer_memory_full (BUF_GAP_SIZE (b) + 1);
332 332
333 b->pt = BEG; 333 b->pt = BEG;
334 b->begv = BEG; 334 b->begv = BEG;
@@ -4892,7 +4892,7 @@ alloc_buffer_text (struct buffer *b, size_t nbytes)
4892 if (p == NULL) 4892 if (p == NULL)
4893 { 4893 {
4894 UNBLOCK_INPUT; 4894 UNBLOCK_INPUT;
4895 memory_full (); 4895 memory_full (nbytes);
4896 } 4896 }
4897 4897
4898 b->text->beg = (unsigned char *) p; 4898 b->text->beg = (unsigned char *) p;
@@ -4920,7 +4920,7 @@ enlarge_buffer_text (struct buffer *b, EMACS_INT delta)
4920 if (p == NULL) 4920 if (p == NULL)
4921 { 4921 {
4922 UNBLOCK_INPUT; 4922 UNBLOCK_INPUT;
4923 memory_full (); 4923 memory_full (nbytes);
4924 } 4924 }
4925 4925
4926 BUF_BEG_ADDR (b) = (unsigned char *) p; 4926 BUF_BEG_ADDR (b) = (unsigned char *) p;