From: Paul Eggert <eggert@cs.ucla.edu>
To: Eli Zaretskii <eliz@gnu.org>
Cc: fabrice.popineau@gmail.com, emacs-devel@gnu.org
Subject: Re: Emacs-26 threads problem [win64]
Date: Sat, 14 Oct 2017 01:05:59 -0700 [thread overview]
Message-ID: <6d41986e-2134-76df-ca37-2f394f1fa81e@cs.ucla.edu> (raw)
In-Reply-To: <837evyjkej.fsf@gnu.org>
[-- Attachment #1: Type: text/plain, Size: 267 bytes --]
Eli Zaretskii wrote:
> Does GCC assume that each struct starts at a 16-byte boundary?
No, only structs needing such an alignment, as is the case here.
Fabrice, I installed the attached patch into the emacs-26 branch; would you
please give it a try? Thanks.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Do-not-under-align-pseudovectors.patch --]
[-- Type: text/x-patch; name="0001-Do-not-under-align-pseudovectors.patch", Size: 1584 bytes --]
From d7038020aa0a868c74cddaed5733ad6eeb73406b Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Sat, 14 Oct 2017 00:55:25 -0700
Subject: [PATCH] Do not under-align pseudovectors
Problem reported by Fabrice Popineau in:
https://lists.gnu.org/archive/html/emacs-devel/2017-10/msg00357.html
Also see diagnosis by Eli Zaretskii in:
https://lists.gnu.org/archive/html/emacs-devel/2017-10/msg00476.html
* src/alloc.c (vector_alignment):
Now a multiple of alignof (max_align_t).
---
src/alloc.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/src/alloc.c b/src/alloc.c
index 2e6399e..da0c3ad 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -2923,9 +2923,13 @@ set_next_vector (struct Lisp_Vector *v, struct Lisp_Vector *p)
enum
{
- /* Alignment of struct Lisp_Vector objects. */
- vector_alignment = COMMON_MULTIPLE (FLEXALIGNOF (struct Lisp_Vector),
- GCALIGNMENT),
+ /* 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)
--
2.7.4
next prev parent reply other threads:[~2017-10-14 8:05 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-09 19:48 Emacs-26 threads problem [win64] Fabrice Popineau
2017-10-10 6:25 ` Eli Zaretskii
2017-10-10 16:13 ` Fabrice Popineau
2017-10-10 16:30 ` Eli Zaretskii
2017-10-10 16:48 ` Eli Zaretskii
2017-10-10 18:57 ` Fabrice Popineau
2017-10-10 19:39 ` Eli Zaretskii
2017-10-10 19:58 ` Fabrice Popineau
2017-10-10 20:09 ` Eli Zaretskii
2017-10-10 20:14 ` Fabrice Popineau
2017-10-11 10:02 ` Eli Zaretskii
2017-10-13 18:52 ` Eli Zaretskii
2017-10-13 22:00 ` Richard Copley
2017-10-14 6:39 ` Eli Zaretskii
2017-10-13 22:28 ` Paul Eggert
2017-10-14 6:47 ` Eli Zaretskii
2017-10-14 8:05 ` Paul Eggert [this message]
2017-10-14 8:25 ` Eli Zaretskii
2017-10-14 9:28 ` Paul Eggert
2017-10-14 9:30 ` Andreas Schwab
2017-10-14 10:33 ` Eli Zaretskii
2017-10-14 11:31 ` Andreas Schwab
2017-10-14 12:18 ` Eli Zaretskii
2017-10-14 12:39 ` Andreas Schwab
2017-10-14 14:00 ` Eli Zaretskii
2017-10-14 22:51 ` Paul Eggert
2017-10-15 15:14 ` Eli Zaretskii
2017-10-15 15:39 ` Andreas Schwab
2017-10-15 16:30 ` Eli Zaretskii
2017-10-15 16:41 ` Stefan Monnier
2017-10-15 17:19 ` Eli Zaretskii
2017-10-15 16:47 ` Andreas Schwab
2017-10-14 9:26 ` Andreas Schwab
2017-10-14 9:31 ` Paul Eggert
2017-10-14 19:06 ` Fabrice Popineau
2017-10-10 18:55 ` Fabrice Popineau
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6d41986e-2134-76df-ca37-2f394f1fa81e@cs.ucla.edu \
--to=eggert@cs.ucla.edu \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=fabrice.popineau@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.