Commit d7038020 authored by Paul Eggert's avatar Paul Eggert

Do not under-align pseudovectors

Problem reported by Fabrice Popineau in:
Also see diagnosis by Eli Zaretskii in:
* src/alloc.c (vector_alignment):
Now a multiple of alignof (max_align_t).
parent ff330530
......@@ -2923,9 +2923,13 @@ set_next_vector (struct Lisp_Vector *v, struct Lisp_Vector *p)
/* Alignment of struct Lisp_Vector objects. */
vector_alignment = COMMON_MULTIPLE (FLEXALIGNOF (struct Lisp_Vector),
/* Alignment of struct Lisp_Vector objects. Because pseudovectors
can contain any C type, align at least as strictly as
max_align_t. On x86 and x86-64 this can waste up to 8 bytes
for typical vectors, since alignof (max_align_t) is 16 but
typical vectors need only an alignment of 8. However, it is
not worth the hassle to avoid wasting those bytes. */
vector_alignment = COMMON_MULTIPLE (alignof (max_align_t), GCALIGNMENT),
/* Vector size requests are a multiple of this. */
roundup_size = COMMON_MULTIPLE (vector_alignment, word_size)
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