From e993f8d5d39431545ac0071655071a740534917b Mon Sep 17 00:00:00 2001 From: Dmitry Antipov Date: Wed, 2 Jul 2014 19:22:49 +0400 Subject: [PATCH] * lisp.h (toplevel): Add compile-time assert to verify suitable member layout in Lisp_Sub_Char_Table. --- src/ChangeLog | 2 ++ src/lisp.h | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 05916477140..bb514753bdb 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -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. diff --git a/src/lisp.h b/src/lisp.h index 3c4845ec79b..6af390604d6 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -1561,7 +1561,11 @@ CHAR_TABLE_EXTRA_SLOTS (struct Lisp_Char_Table *ct) - CHAR_TABLE_STANDARD_SLOTS); } - +/* 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 ***********************************************************************/ -- 2.39.2