[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master b76389f 2/7: Don’t over-align if WIDE_EMACS_INT
From: |
Paul Eggert |
Subject: |
[Emacs-diffs] master b76389f 2/7: Don’t over-align if WIDE_EMACS_INT |
Date: |
Thu, 7 Jun 2018 22:11:56 -0400 (EDT) |
branch: master
commit b76389f22070bb61811eeea41635640d31115fd9
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>
Don’t over-align if WIDE_EMACS_INT
* src/lisp.h (GCALIGNED_UNION): New macro.
(struct Lisp_Symbol, union vectorlike_header)
(struct Lisp_Cons, struct Lisp_String):
Use it to avoid possible over-alignment if !USE_LSB_TAG.
---
src/lisp.h | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/src/lisp.h b/src/lisp.h
index c5af4fa..5b296cd 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -229,7 +229,7 @@ extern bool suppress_checking EXTERNALLY_VISIBLE;
USE_LSB_TAG not only requires the least 3 bits of pointers returned by
malloc to be 0 but also needs to be able to impose a mult-of-8 alignment
on some non-GC Lisp_Objects, all of which are aligned via
- 'char alignas (GCALIGNMENT) gcaligned;' inside a union. */
+ GCALIGNED_UNION at the end of a union. */
enum Lisp_Bits
{
@@ -277,6 +277,12 @@ DEFINE_GDB_SYMBOL_END (VALMASK)
error !;
#endif
+#if USE_LSB_TAG
+# define GCALIGNED_UNION char alignas (GCALIGNMENT) gcaligned;
+#else
+# define GCALIGNED_UNION
+#endif
+
/* Lisp_Word is a scalar word suitable for holding a tagged pointer or
integer. Usually it is a pointer to a deliberately-incomplete type
'union Lisp_X'. However, it is EMACS_INT when Lisp_Objects and
@@ -776,7 +782,7 @@ struct Lisp_Symbol
/* Next symbol in obarray bucket, if the symbol is interned. */
struct Lisp_Symbol *next;
} s;
- char alignas (GCALIGNMENT) gcaligned;
+ GCALIGNED_UNION
} u;
};
verify (alignof (struct Lisp_Symbol) % GCALIGNMENT == 0);
@@ -890,7 +896,7 @@ union vectorlike_header
Current layout limits the pseudovectors to 63 PVEC_xxx subtypes,
4095 Lisp_Objects in GC-ed area and 4095 word-sized other slots. */
ptrdiff_t size;
- char alignas (GCALIGNMENT) gcaligned;
+ GCALIGNED_UNION
};
verify (alignof (union vectorlike_header) % GCALIGNMENT == 0);
@@ -1250,7 +1256,7 @@ struct Lisp_Cons
struct Lisp_Cons *chain;
} u;
} s;
- char alignas (GCALIGNMENT) gcaligned;
+ GCALIGNED_UNION
} u;
};
verify (alignof (struct Lisp_Cons) % GCALIGNMENT == 0);
@@ -1372,7 +1378,7 @@ struct Lisp_String
unsigned char *data;
} s;
struct Lisp_String *next;
- char alignas (GCALIGNMENT) gcaligned;
+ GCALIGNED_UNION
} u;
};
verify (alignof (struct Lisp_String) % GCALIGNMENT == 0);
- [Emacs-diffs] master updated (9966842 -> e2a9800), Paul Eggert, 2018/06/07
- [Emacs-diffs] master 4d176b7 3/7: Fix ftfont_open2 failure cleanup, Paul Eggert, 2018/06/07
- [Emacs-diffs] master 7c16392 1/7: Fix GC-related commentary, Paul Eggert, 2018/06/07
- [Emacs-diffs] master b76389f 2/7: Don’t over-align if WIDE_EMACS_INT,
Paul Eggert <=
- [Emacs-diffs] master a064128 4/7: * src/.gdbinit: Omit soon-obsolete comment., Paul Eggert, 2018/06/07
- [Emacs-diffs] master e2a9800 7/7: Fit kill_buffer_xwidgets into 80, Paul Eggert, 2018/06/07
- [Emacs-diffs] master a0aa1d4 5/7: New function record_unwind_protect_excursion, Paul Eggert, 2018/06/07
- [Emacs-diffs] master 0e1bfd3 6/7: Minor cleanup of save_excursion_restore, Paul Eggert, 2018/06/07