emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 7e24039: * src/lisp.h: Add explanation in a comment


From: Stefan Monnier
Subject: [Emacs-diffs] master 7e24039: * src/lisp.h: Add explanation in a comment
Date: Sat, 1 Sep 2018 18:51:33 -0400 (EDT)

branch: master
commit 7e24039a9747cc1117b17631511e42cb3576362b
Author: Stefan Monnier <address@hidden>
Commit: Stefan Monnier <address@hidden>

    * src/lisp.h: Add explanation in a comment
---
 src/lisp.h | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/lisp.h b/src/lisp.h
index 36ca32c..d244bc0 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -866,7 +866,16 @@ 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;
-    /* Align the union so that there is no padding after it.  */
+    /* Align the union so that there is no padding after it.
+       This is needed for the following reason:
+       If the alignment constraint of Lisp_Object is greater than the size of
+       vectorlike_header (e.g. with-wide-int), vectorlike objects which have
+       0 Lisp_Object fields and whose 1st field has a smaller alignment
+       constraint than Lisp_Object may end up with their 1st field "before
+       pseudovector index 0", in which case PSEUDOVECSIZE will return
+       a "negative" number.  We could fix PSEUDOVECSIZE, but it's easier to
+       just force rounding up the size of vectorlike_header to the alignment
+       of Lisp_Object.  */
     Lisp_Object align;
     GCALIGNED_UNION
   };



reply via email to

[Prev in Thread] Current Thread [Next in Thread]