aboutsummaryrefslogtreecommitdiffstats
path: root/src/alloc.c
diff options
context:
space:
mode:
authorPaul Eggert2011-04-17 21:25:27 -0700
committerPaul Eggert2011-04-17 21:25:27 -0700
commitc7bda33cad5112de8c093dce0eaf62c84fb32063 (patch)
treec99ec573279ce2a77813d7480a817a48f455e154 /src/alloc.c
parent000098c13577337d3bb8cb381bd16701dc11cc32 (diff)
downloademacs-c7bda33cad5112de8c093dce0eaf62c84fb32063.tar.gz
emacs-c7bda33cad5112de8c093dce0eaf62c84fb32063.zip
* 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).
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/alloc.c b/src/alloc.c
index 2af75e3c471..2d1c8ffe70b 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -1055,7 +1055,8 @@ allocate_buffer (void)
1055 struct buffer *b 1055 struct buffer *b
1056 = (struct buffer *) lisp_malloc (sizeof (struct buffer), 1056 = (struct buffer *) lisp_malloc (sizeof (struct buffer),
1057 MEM_TYPE_BUFFER); 1057 MEM_TYPE_BUFFER);
1058 b->size = sizeof (struct buffer) / sizeof (EMACS_INT); 1058 b->size = ((sizeof (struct buffer) + sizeof (EMACS_INT) - 1)
1059 / sizeof (EMACS_INT));
1059 XSETPVECTYPE (b, PVEC_BUFFER); 1060 XSETPVECTYPE (b, PVEC_BUFFER);
1060 return b; 1061 return b;
1061} 1062}