]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp.h (toplevel): Add compile-time assert to verify suitable member layout
authorDmitry Antipov <dmantipov@yandex.ru>
Wed, 2 Jul 2014 15:22:49 +0000 (19:22 +0400)
committerDmitry Antipov <dmantipov@yandex.ru>
Wed, 2 Jul 2014 15:22:49 +0000 (19:22 +0400)
in Lisp_Sub_Char_Table.

src/ChangeLog
src/lisp.h

index 059164771408572f09c85a30e54f081a2e2238da..bb514753bdb8ead090cacb3f8ebbc1a6ce25e089 100644 (file)
@@ -6,6 +6,8 @@
        (enum char_table_specials): Rename from CHAR_TABLE_STANDARD_SLOTS.
        Add SUB_CHAR_TABLE_OFFSET member.
        (make_uninit_sub_char_table): New function.
+       (toplevel): Add compile-time assert to verify suitable member layout
+       in Lisp_Sub_Char_Table.
        * alloc.c (mark_char_table): Add extra argument to denote char table
        subtype.  Adjust to match new layout of sub char-table.
        (mark_object): Always mark sub char-tables with mark_char_table.
index 3c4845ec79b3b71020e632db88af016bd87a5de0..6af390604d664ea3c882c128a8b4b0ddf008a881 100644 (file)
@@ -1561,7 +1561,11 @@ CHAR_TABLE_EXTRA_SLOTS (struct Lisp_Char_Table *ct)
          - CHAR_TABLE_STANDARD_SLOTS);
 }
 
-\f
+/* Make sure that sub char-table contents slot
+   is aligned on a multiple of Lisp_Objects.  */
+verify ((offsetof (struct Lisp_Sub_Char_Table, contents)
+        - offsetof (struct Lisp_Sub_Char_Table, depth)) % word_size == 0);
+
 /***********************************************************************
                               Symbols
  ***********************************************************************/