diff options
| author | Mattias EngdegÄrd | 2024-02-06 15:23:53 +0100 |
|---|---|---|
| committer | Mattias EngdegÄrd | 2024-02-06 15:23:53 +0100 |
| commit | 05e3183ede3a08993a7d209fb14153abaed0c74e (patch) | |
| tree | 75cf18365469d5d08ee32c6fee692b028796c2cb | |
| parent | e66870400d45e3d08265df9f6acd4631a5712139 (diff) | |
| download | emacs-05e3183ede3a08993a7d209fb14153abaed0c74e.tar.gz emacs-05e3183ede3a08993a7d209fb14153abaed0c74e.zip | |
Rearrange and pack hash table fields to reduce space
* src/lisp.h (struct Lisp_Hash_Table): Move and reduce width of fields
where possible; this saves an entire word at no apparent cost.
| -rw-r--r-- | src/lisp.h | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/lisp.h b/src/lisp.h index d6bbf15d83b..5326824bf38 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -2475,9 +2475,6 @@ struct Lisp_Hash_Table | |||
| 2475 | The table is physically split into three vectors (hash, next, | 2475 | The table is physically split into three vectors (hash, next, |
| 2476 | key_and_value) which may or may not be beneficial. */ | 2476 | key_and_value) which may or may not be beneficial. */ |
| 2477 | 2477 | ||
| 2478 | int index_bits; /* log2 (size of the index vector). */ | ||
| 2479 | hash_idx_t table_size; /* Size of the next and hash vectors. */ | ||
| 2480 | |||
| 2481 | /* Bucket vector. An entry of -1 indicates no item is present, | 2478 | /* Bucket vector. An entry of -1 indicates no item is present, |
| 2482 | and a nonnegative entry is the index of the first item in | 2479 | and a nonnegative entry is the index of the first item in |
| 2483 | a collision chain. | 2480 | a collision chain. |
| @@ -2514,20 +2511,24 @@ struct Lisp_Hash_Table | |||
| 2514 | /* Index of first free entry in free list, or -1 if none. */ | 2511 | /* Index of first free entry in free list, or -1 if none. */ |
| 2515 | hash_idx_t next_free; | 2512 | hash_idx_t next_free; |
| 2516 | 2513 | ||
| 2514 | hash_idx_t table_size; /* Size of the next and hash vectors. */ | ||
| 2515 | |||
| 2516 | unsigned char index_bits; /* log2 (size of the index vector). */ | ||
| 2517 | |||
| 2517 | /* Weakness of the table. */ | 2518 | /* Weakness of the table. */ |
| 2518 | hash_table_weakness_t weakness : 8; | 2519 | hash_table_weakness_t weakness : 3; |
| 2519 | 2520 | ||
| 2520 | /* Hash table test (only used when frozen in dump) */ | 2521 | /* Hash table test (only used when frozen in dump) */ |
| 2521 | hash_table_std_test_t frozen_test : 8; | 2522 | hash_table_std_test_t frozen_test : 2; |
| 2522 | 2523 | ||
| 2523 | /* True if the table can be purecopied. The table cannot be | 2524 | /* True if the table can be purecopied. The table cannot be |
| 2524 | changed afterwards. */ | 2525 | changed afterwards. */ |
| 2525 | bool purecopy; | 2526 | bool_bf purecopy : 1; |
| 2526 | 2527 | ||
| 2527 | /* True if the table is mutable. Ordinarily tables are mutable, but | 2528 | /* True if the table is mutable. Ordinarily tables are mutable, but |
| 2528 | pure tables are not, and while a table is being mutated it is | 2529 | pure tables are not, and while a table is being mutated it is |
| 2529 | immutable for recursive attempts to mutate it. */ | 2530 | immutable for recursive attempts to mutate it. */ |
| 2530 | bool mutable; | 2531 | bool_bf mutable : 1; |
| 2531 | 2532 | ||
| 2532 | /* Next weak hash table if this is a weak hash table. The head of | 2533 | /* Next weak hash table if this is a weak hash table. The head of |
| 2533 | the list is in weak_hash_tables. Used only during garbage | 2534 | the list is in weak_hash_tables. Used only during garbage |