summaryrefslogtreecommitdiff
path: root/src/charset.h
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2024-01-23 22:30:13 -0500
committerStefan Monnier <monnier@iro.umontreal.ca>2024-01-23 22:30:13 -0500
commit33b8d5b6c5a22bab069cdac4bddda932b3d18b13 (patch)
tree9ebfcc61c0fb90681b89857a34a843591a6327ad /src/charset.h
parent13c7249105ec0d1a070c6d4e9f73f3c21d905bc8 (diff)
downloademacs-33b8d5b6c5a22bab069cdac4bddda932b3d18b13.tar.gz
(struct charset): Remove dependency on hash-table internals
`struct charset` kept an index into the internal `key_and_value` array of hash tables, which only worked because of details of how hash-tables are handled. Replace it with a reference to the value stored at that location in the hash-table, which saves us an indirection while at it. * src/charset.h (struct charset): Replace `hash_index` field with `attributes` field. (CHARSET_ATTRIBUTES): Simplify accordingly. (CHARSET_HASH_INDEX): Delete unused macro. * src/charset.c (Fdefine_charset_internal): * src/pdumper.c (dump_charset): Adjust accordingly. (dump_charset_table): Set the referrer since that's needed while dumping Lisp_Object fields.
Diffstat (limited to 'src/charset.h')
-rw-r--r--src/charset.h7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/charset.h b/src/charset.h
index ba83cd5ccb2..1edb4a248ac 100644
--- a/src/charset.h
+++ b/src/charset.h
@@ -150,8 +150,7 @@ struct charset
/* Index to charset_table. */
int id;
- /* Index to Vcharset_hash_table. */
- ptrdiff_t hash_index;
+ Lisp_Object attributes;
/* Dimension of the charset: 1, 2, 3, or 4. */
int dimension;
@@ -289,11 +288,9 @@ extern int emacs_mule_charset[256];
hash_lookup (XHASH_TABLE (Vcharset_hash_table), symbol)
/* Return the attribute vector of CHARSET. */
-#define CHARSET_ATTRIBUTES(charset) \
- HASH_VALUE (XHASH_TABLE (Vcharset_hash_table), (charset)->hash_index)
+#define CHARSET_ATTRIBUTES(charset) (charset)->attributes
#define CHARSET_ID(charset) ((charset)->id)
-#define CHARSET_HASH_INDEX(charset) ((charset)->hash_index)
#define CHARSET_DIMENSION(charset) ((charset)->dimension)
#define CHARSET_CODE_SPACE(charset) ((charset)->code_space)
#define CHARSET_CODE_LINEAR_P(charset) ((charset)->code_linear_p)