(struct composition): Remove dependency on hash-table internals
authorStefan Monnier <monnier@iro.umontreal.ca>
Wed, 24 Jan 2024 13:16:11 +0000 (08:16 -0500)
committerStefan Monnier <monnier@iro.umontreal.ca>
Wed, 24 Jan 2024 13:16:41 +0000 (08:16 -0500)
commitcc861fc528b49fc459bb9a1e5054f5fd82e1b689
tree40f6b9e42f1d3cc9c9396051b3f84bfefb993ae3
parent3018c6e7ba5d35b756aea5eed7f3981548a597b4
(struct composition): Remove dependency on hash-table internals

`struct composition` 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
key stored at that location in the hash-table, which saves us an
indirection while at it.

* src/composite.h (struct composition): Replace `hash_index` with
the actual `key`.
(COMPOSITION_KEY): Simplify accordingly.
(mark_composite): Declare.
* src/composite.c (get_composition_id): Adjust accordingly.
(mark_composite): New function.

* src/charset.c (mark_charset): Uncomment.
* src/lisp.h (mark_charset): Declare.
* src/alloc.c (garbage_collect): Call `mark_charset` and `mark_composite`.
* src/pdumper.c (hash_table_contents): Remove invalid comment, since
compositions aren't dumped.
src/alloc.c
src/charset.c
src/composite.c
src/composite.h
src/lisp.h
src/pdumper.c