]> git.eshelyaron.com Git - emacs.git/commit
(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)
committerEshel Yaron <me@eshelyaron.com>
Wed, 24 Jan 2024 18:31:54 +0000 (19:31 +0100)
commit609f9b0bc029c4d54fd3dce62784d0f3c796479e
tree051b17efa85a454c5ca8c2430d30e56be46b66d3
parent6c24990dbdfee4cf672a7f327d1d1a908e5f18a0
(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.

(cherry picked from commit cc861fc528b49fc459bb9a1e5054f5fd82e1b689)
src/alloc.c
src/charset.c
src/composite.c
src/composite.h
src/lisp.h
src/pdumper.c