diff options
| author | Dmitry Antipov | 2014-07-02 07:26:19 +0400 |
|---|---|---|
| committer | Dmitry Antipov | 2014-07-02 07:26:19 +0400 |
| commit | 477daa5b533af8f62c9b6893e2d522b93d9c2853 (patch) | |
| tree | 1dc2bb83f76ecfecbce218a9af3a2bf845f5e3b6 /src/alloc.c | |
| parent | 1dc6f7e738e3ffe130626814f721c83c448fe9a8 (diff) | |
| download | emacs-477daa5b533af8f62c9b6893e2d522b93d9c2853.tar.gz emacs-477daa5b533af8f62c9b6893e2d522b93d9c2853.zip | |
Shrink Lisp_Sub_Char_Table by preferring C integers to Lisp_Objects.
* lisp.h (struct Lisp_Sub_Char_Table): Use C integers for depth and
min_char slots. Adjust comment.
(enum char_table_specials): Rename from CHAR_TABLE_STANDARD_SLOTS.
Add SUB_CHAR_TABLE_OFFSET member.
(make_uninit_sub_char_table): New function.
* 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.
* chartab.c (make_sub_char_table, copy_sub_char_table)
(sub_char_table_ref, sub_char_table_ref_and_range, sub_char_table_set)
(sub_char_table_set_range, optimize_sub_char_table, map_sub_char_table)
(map_sub_char_table_for_charset, uniprop_table_uncompress):
All related users changed.
* lread.c (read1): Adjust to match new layout of sub char-table.
Diffstat (limited to 'src/alloc.c')
| -rw-r--r-- | src/alloc.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/alloc.c b/src/alloc.c index e2213db853d..6eb2e756ed1 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -5958,14 +5958,15 @@ mark_vectorlike (struct Lisp_Vector *ptr) | |||
| 5958 | symbols. */ | 5958 | symbols. */ |
| 5959 | 5959 | ||
| 5960 | static void | 5960 | static void |
| 5961 | mark_char_table (struct Lisp_Vector *ptr) | 5961 | mark_char_table (struct Lisp_Vector *ptr, enum pvec_type pvectype) |
| 5962 | { | 5962 | { |
| 5963 | int size = ptr->header.size & PSEUDOVECTOR_SIZE_MASK; | 5963 | int size = ptr->header.size & PSEUDOVECTOR_SIZE_MASK; |
| 5964 | int i; | 5964 | /* Consult the Lisp_Sub_Char_Table layout before changing this. */ |
| 5965 | int i, idx = (pvectype == PVEC_SUB_CHAR_TABLE ? SUB_CHAR_TABLE_OFFSET : 0); | ||
| 5965 | 5966 | ||
| 5966 | eassert (!VECTOR_MARKED_P (ptr)); | 5967 | eassert (!VECTOR_MARKED_P (ptr)); |
| 5967 | VECTOR_MARK (ptr); | 5968 | VECTOR_MARK (ptr); |
| 5968 | for (i = 0; i < size; i++) | 5969 | for (i = idx; i < size; i++) |
| 5969 | { | 5970 | { |
| 5970 | Lisp_Object val = ptr->contents[i]; | 5971 | Lisp_Object val = ptr->contents[i]; |
| 5971 | 5972 | ||
| @@ -5974,7 +5975,7 @@ mark_char_table (struct Lisp_Vector *ptr) | |||
| 5974 | if (SUB_CHAR_TABLE_P (val)) | 5975 | if (SUB_CHAR_TABLE_P (val)) |
| 5975 | { | 5976 | { |
| 5976 | if (! VECTOR_MARKED_P (XVECTOR (val))) | 5977 | if (! VECTOR_MARKED_P (XVECTOR (val))) |
| 5977 | mark_char_table (XVECTOR (val)); | 5978 | mark_char_table (XVECTOR (val), PVEC_SUB_CHAR_TABLE); |
| 5978 | } | 5979 | } |
| 5979 | else | 5980 | else |
| 5980 | mark_object (val); | 5981 | mark_object (val); |
| @@ -6320,7 +6321,8 @@ mark_object (Lisp_Object arg) | |||
| 6320 | break; | 6321 | break; |
| 6321 | 6322 | ||
| 6322 | case PVEC_CHAR_TABLE: | 6323 | case PVEC_CHAR_TABLE: |
| 6323 | mark_char_table (ptr); | 6324 | case PVEC_SUB_CHAR_TABLE: |
| 6325 | mark_char_table (ptr, (enum pvec_type) pvectype); | ||
| 6324 | break; | 6326 | break; |
| 6325 | 6327 | ||
| 6326 | case PVEC_BOOL_VECTOR: | 6328 | case PVEC_BOOL_VECTOR: |
| @@ -7218,7 +7220,7 @@ The time is in seconds as a floating point value. */); | |||
| 7218 | union | 7220 | union |
| 7219 | { | 7221 | { |
| 7220 | enum CHARTAB_SIZE_BITS CHARTAB_SIZE_BITS; | 7222 | enum CHARTAB_SIZE_BITS CHARTAB_SIZE_BITS; |
| 7221 | enum CHAR_TABLE_STANDARD_SLOTS CHAR_TABLE_STANDARD_SLOTS; | 7223 | enum char_table_specials char_table_specials; |
| 7222 | enum char_bits char_bits; | 7224 | enum char_bits char_bits; |
| 7223 | enum CHECK_LISP_OBJECT_TYPE CHECK_LISP_OBJECT_TYPE; | 7225 | enum CHECK_LISP_OBJECT_TYPE CHECK_LISP_OBJECT_TYPE; |
| 7224 | enum DEFAULT_HASH_SIZE DEFAULT_HASH_SIZE; | 7226 | enum DEFAULT_HASH_SIZE DEFAULT_HASH_SIZE; |