multiple of sizeof (EMACS_INT); it need not be, if
alignof(EMACS_INT) < sizeof (EMACS_INT).
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>
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;
}