Commit c7bda33c authored by Paul Eggert's avatar Paul Eggert

* alloc.c (allocate_buffer): Don't assume sizeof (struct buffer) is a

multiple of sizeof (EMACS_INT); it need not be, if
alignof(EMACS_INT) < sizeof (EMACS_INT).
parent 000098c1
......@@ -6,6 +6,9 @@
don't formally overflow signed char, to avoid warnings.
(allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
can cause Emacs to crash when string overrun checking is enabled.
(allocate_buffer): Don't assume sizeof (struct buffer) is a
multiple of sizeof (EMACS_INT); it need not be, if
alignof(EMACS_INT) < sizeof (EMACS_INT).
2011-04-17 Chong Yidong <cyd@stupidchicken.com>
......
......@@ -1055,7 +1055,8 @@ allocate_buffer (void)
struct buffer *b
= (struct buffer *) lisp_malloc (sizeof (struct buffer),
MEM_TYPE_BUFFER);
b->size = sizeof (struct buffer) / sizeof (EMACS_INT);
b->size = ((sizeof (struct buffer) + sizeof (EMACS_INT) - 1)
/ sizeof (EMACS_INT));
XSETPVECTYPE (b, PVEC_BUFFER);
return b;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment