<feed xmlns='http://www.w3.org/2005/Atom'>
<title>emacs/src/data.c, branch feature/igc</title>
<subtitle>Emacs is the extensible, customizable, self-documenting real-time display editor. 
</subtitle>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/'/>
<entry>
<title>Merge branch 'master' into feature/igc</title>
<updated>2026-02-13T08:10:16+00:00</updated>
<author>
<name>Helmut Eller</name>
</author>
<published>2026-02-13T08:10:16+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=91c9e9883488d715a30877dfd7641ef4b3c62658'/>
<id>91c9e9883488d715a30877dfd7641ef4b3c62658</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Move the Lisp_Fwd.bufoffset field back to the union</title>
<updated>2026-02-12T17:51:51+00:00</updated>
<author>
<name>Helmut Eller</name>
</author>
<published>2024-06-24T08:06:54+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=40f696757c2afe15a583945992955429b00de563'/>
<id>40f696757c2afe15a583945992955429b00de563</id>
<content type='text'>
* src/lisp.h (struct Lisp_Fwd): With the predicate enum, we can now pack
the offset and the predicate into a one-word struct.
(XBUFFER_OFFSET): Use the new field name.
* src/buffer.c (DEFVAR_PER_BUFFER): Create the one-word struct.
* src/data.c (store_symval_forwarding): Use the new field name.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* src/lisp.h (struct Lisp_Fwd): With the predicate enum, we can now pack
the offset and the predicate into a one-word struct.
(XBUFFER_OFFSET): Use the new field name.
* src/buffer.c (DEFVAR_PER_BUFFER): Create the one-word struct.
* src/data.c (store_symval_forwarding): Use the new field name.
</pre>
</div>
</content>
</entry>
<entry>
<title>Introduce an enum Lisp_Fwd_Predicate</title>
<updated>2026-02-12T17:51:51+00:00</updated>
<author>
<name>Helmut Eller</name>
</author>
<published>2024-06-23T19:46:16+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=9008e6a9d7f041875c2fe9f58d5b5b44e84f649f'/>
<id>9008e6a9d7f041875c2fe9f58d5b5b44e84f649f</id>
<content type='text'>
Using an enum instead of a symbol makes it obvious that this field is
of no concern to the GC.

* src/lisp.h (enum Lisp_Fwd_Predicate): New.
(struct Lisp_Fwd): Use it instead of a symbol.
* src/buffer.c (DEFVAR_PER_BUFFER): Create the necessary enum constant
instead of a symbol.
* src/data.c (check_fwd_predicate, check_choice): New helpers.
(store_symval_forwarding): Use it.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Using an enum instead of a symbol makes it obvious that this field is
of no concern to the GC.

* src/lisp.h (enum Lisp_Fwd_Predicate): New.
(struct Lisp_Fwd): Use it instead of a symbol.
* src/buffer.c (DEFVAR_PER_BUFFER): Create the necessary enum constant
instead of a symbol.
* src/data.c (check_fwd_predicate, check_choice): New helpers.
(store_symval_forwarding): Use it.
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove struct Lisp_Buffer_Objfwd</title>
<updated>2026-02-12T17:51:51+00:00</updated>
<author>
<name>Helmut Eller</name>
</author>
<published>2024-06-23T15:25:21+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=3442fdd2a2d9702bf9ed856b9bf0a0b1d0992747'/>
<id>3442fdd2a2d9702bf9ed856b9bf0a0b1d0992747</id>
<content type='text'>
* src/lisp.h (struct Lisp_Buffer_Objfwd): Deleted.
(struct Lisp_Fwd): Add the fields bufoffset and bufpredicate.
Make the type a 1-byte bitfield so that the entire struct still
fits in two words.
(XBUFFER_OFFSET): Renamed from XBUFFER_OBJFWD.
* src/buffer.c (DEFVAR_PER_BUFFER, defvar_per_buffer)
(buffer_local_value): Update accordingly.
* src/data.c (do_symval_forwarding, store_symval_forwarding)
(set_internal, default_value, set_default_internal)
(Fmake_local_variable, Fkill_local_variable, Flocal_variable_): Use
XBUFFER_OFFSET.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* src/lisp.h (struct Lisp_Buffer_Objfwd): Deleted.
(struct Lisp_Fwd): Add the fields bufoffset and bufpredicate.
Make the type a 1-byte bitfield so that the entire struct still
fits in two words.
(XBUFFER_OFFSET): Renamed from XBUFFER_OBJFWD.
* src/buffer.c (DEFVAR_PER_BUFFER, defvar_per_buffer)
(buffer_local_value): Update accordingly.
* src/data.c (do_symval_forwarding, store_symval_forwarding)
(set_internal, default_value, set_default_internal)
(Fmake_local_variable, Fkill_local_variable, Flocal_variable_): Use
XBUFFER_OFFSET.
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove struct Lisp_Kboard_Objfwd</title>
<updated>2026-02-12T17:51:51+00:00</updated>
<author>
<name>Helmut Eller</name>
</author>
<published>2024-06-23T14:36:13+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=163dd21e7305bbd91aecb87cb4968970d1e1e873'/>
<id>163dd21e7305bbd91aecb87cb4968970d1e1e873</id>
<content type='text'>
* src/lisp.h (struct Lisp_Kboard_Objfwd): Deleted ...
(struct Lisp_Fwd): ... replaced with field kbdoffset.
(DEFVAR_KBOARD): Use new field.
* src/data.c (XKBOARD_OFFSET): Renamed from XKBOARD_OBJFWD.
(do_symval_forwarding, store_symval_forwarding
(set_default_internal): Use it .
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* src/lisp.h (struct Lisp_Kboard_Objfwd): Deleted ...
(struct Lisp_Fwd): ... replaced with field kbdoffset.
(DEFVAR_KBOARD): Use new field.
* src/data.c (XKBOARD_OFFSET): Renamed from XKBOARD_OBJFWD.
(do_symval_forwarding, store_symval_forwarding
(set_default_internal): Use it .
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove struct Lisp_Objfwd</title>
<updated>2026-02-12T17:51:51+00:00</updated>
<author>
<name>Helmut Eller</name>
</author>
<published>2024-06-23T13:34:55+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=d109bcf86e870d003b45930c82f8140e8ba415ac'/>
<id>d109bcf86e870d003b45930c82f8140e8ba415ac</id>
<content type='text'>
* src/lisp.h (struct Lisp_Objfwd): Deleted.
(struct Lisp_Fwd): Replace it with objvar field.
(DEFVAR_LISP, DEFVAR_LISP_NOPRO, DEFVAR_LISP_NOPROX): Use the field.
* src/lread.c (defvar_lisp): Updated as needed.
* src/pdumper.c (dump_field_fwd): Use the field.
* src/data.c (XOBJVAR): Renamed and updated from XOBJFWD.
(do_symval_forwarding, store_symval_forwarding): Use it.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* src/lisp.h (struct Lisp_Objfwd): Deleted.
(struct Lisp_Fwd): Replace it with objvar field.
(DEFVAR_LISP, DEFVAR_LISP_NOPRO, DEFVAR_LISP_NOPROX): Use the field.
* src/lread.c (defvar_lisp): Updated as needed.
* src/pdumper.c (dump_field_fwd): Use the field.
* src/data.c (XOBJVAR): Renamed and updated from XOBJFWD.
(do_symval_forwarding, store_symval_forwarding): Use it.
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove struct Lisp_Boolfwd</title>
<updated>2026-02-12T17:51:51+00:00</updated>
<author>
<name>Helmut Eller</name>
</author>
<published>2024-06-23T09:37:58+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=9d9189f74c5bd23b249833d70c4390cdbf16fc68'/>
<id>9d9189f74c5bd23b249833d70c4390cdbf16fc68</id>
<content type='text'>
* src/lisp.h (struct Lisp Boolfwd): Deleted
(struct Lisp_Fwd): Replaced it with a boolvar field.
(DEFVAR_BOOL): Update.
* src/data.c (XBOOLVAR): Renamed from XBOOLFWD.
(do_symval_forwarding, store_symval_forwarding): Use it.
* src/pdumper.c (dump_field_fwd): Use boolvar field.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* src/lisp.h (struct Lisp Boolfwd): Deleted
(struct Lisp_Fwd): Replaced it with a boolvar field.
(DEFVAR_BOOL): Update.
* src/data.c (XBOOLVAR): Renamed from XBOOLFWD.
(do_symval_forwarding, store_symval_forwarding): Use it.
* src/pdumper.c (dump_field_fwd): Use boolvar field.
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove struct Lisp_Intfwd</title>
<updated>2026-02-12T17:51:51+00:00</updated>
<author>
<name>Helmut Eller</name>
</author>
<published>2024-06-23T09:25:35+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=6d9ba8e7bf045155bdd6dfbf8126fe866fd3e3aa'/>
<id>6d9ba8e7bf045155bdd6dfbf8126fe866fd3e3aa</id>
<content type='text'>
It was a struct with a single field.

* src/lisp.h (struct Lisp_Intfwd): Deleted.
(struct Lisp_Fwd): Add an intvar field instead.
(DEFVAR_INT): Update accordingly.
* src/data.c (XINTVAR): Updated and renamed from XFIXNUMFWD.
(do_symval_forwarding, store_symval_forwarding): Use it.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It was a struct with a single field.

* src/lisp.h (struct Lisp_Intfwd): Deleted.
(struct Lisp_Fwd): Add an intvar field instead.
(DEFVAR_INT): Update accordingly.
* src/data.c (XINTVAR): Updated and renamed from XFIXNUMFWD.
(do_symval_forwarding, store_symval_forwarding): Use it.
</pre>
</div>
</content>
</entry>
<entry>
<title>Introduce a struct Lisp_Fwd</title>
<updated>2026-02-12T17:51:50+00:00</updated>
<author>
<name>Helmut Eller</name>
</author>
<published>2024-06-23T04:39:18+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=10befec978d1f1490f1eb43fd590e9474252063f'/>
<id>10befec978d1f1490f1eb43fd590e9474252063f</id>
<content type='text'>
This contains the type and an union of Lisp_Objfwd, Lisp_Intfwd etc.
lispfwd is now a pointer to a struct Lisp_Fwd; the void *fwdptr field is
gone.

* src/lisp.h (struct Lisp_Fwd): New.
(Lisp_Intfwd, Lisp_Boolfwd, Lisp_Objfwd, Lisp_Buffer_Objfwd)
(Lisp_Kboard_Objfwd): The type is in in Lisp_Fwd.
(lispwfd): Is now a pointer to struct Lisp_Fwd.
(SYMBOL_BLV, SET_SYMBOL_FWD, XFWDTYPE, BUFFER_OBJFWDP): Update
accordingly.
(defvar_lisp, defvar_lisp_nopro, defvar_bool, defvar_int)
(defvar_kboard): These all take now a Lisp_Fwd.
(DEFVAR_LISP, DEFVAR_LISP_NOPRO, DEFVAR_BOOL, DEFVAR_INT)
(DEFVAR_KBOARD): Update for new types.
* src/lread.c (defvar_int, defvar_bool, defvar_lisp_nopro)
(defvar_lisp, defvar_kboard): Update for new types.
* src/pdumper.c (dump_field_fwd, dump_blv): Update accordingly.
(dump_fwd_int, dump_fwd_bool, dump_fwd_obj, dump_fwd_buffer_obj)
(dump_fwd): Deleted.
* src/buffer.c (DEFVAR_PER_BUFFER, defvar_per_buffer, buffer_local_value)
(set_buffer_internal_1): Update accordingly for new types.
* src/data.c (XBOOLFWD, XKBOARD_OBJFWD, XFIXNUMFWD, XOBJFWD, boundp)
(store_symval_forwarding, swap_in_global_binding)
(swap_in_symval_forwarding, find_symbol_value, set_internal)
(default_value, set_default_internal, make_blv, Fmake_local_variable):
Update accordingly.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This contains the type and an union of Lisp_Objfwd, Lisp_Intfwd etc.
lispfwd is now a pointer to a struct Lisp_Fwd; the void *fwdptr field is
gone.

* src/lisp.h (struct Lisp_Fwd): New.
(Lisp_Intfwd, Lisp_Boolfwd, Lisp_Objfwd, Lisp_Buffer_Objfwd)
(Lisp_Kboard_Objfwd): The type is in in Lisp_Fwd.
(lispwfd): Is now a pointer to struct Lisp_Fwd.
(SYMBOL_BLV, SET_SYMBOL_FWD, XFWDTYPE, BUFFER_OBJFWDP): Update
accordingly.
(defvar_lisp, defvar_lisp_nopro, defvar_bool, defvar_int)
(defvar_kboard): These all take now a Lisp_Fwd.
(DEFVAR_LISP, DEFVAR_LISP_NOPRO, DEFVAR_BOOL, DEFVAR_INT)
(DEFVAR_KBOARD): Update for new types.
* src/lread.c (defvar_int, defvar_bool, defvar_lisp_nopro)
(defvar_lisp, defvar_kboard): Update for new types.
* src/pdumper.c (dump_field_fwd, dump_blv): Update accordingly.
(dump_fwd_int, dump_fwd_bool, dump_fwd_obj, dump_fwd_buffer_obj)
(dump_fwd): Deleted.
* src/buffer.c (DEFVAR_PER_BUFFER, defvar_per_buffer, buffer_local_value)
(set_buffer_internal_1): Update accordingly for new types.
* src/data.c (XBOOLFWD, XKBOARD_OBJFWD, XFIXNUMFWD, XOBJFWD, boundp)
(store_symval_forwarding, swap_in_global_binding)
(swap_in_symval_forwarding, find_symbol_value, set_internal)
(default_value, set_default_internal, make_blv, Fmake_local_variable):
Update accordingly.
</pre>
</div>
</content>
</entry>
<entry>
<title>Alternative implementation for weak hash tables</title>
<updated>2026-02-02T21:29:19+00:00</updated>
<author>
<name>Helmut Eller</name>
</author>
<published>2026-02-02T21:29:19+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=51f686e688b3bd437c5e89ac6a3f213f9f990142'/>
<id>51f686e688b3bd437c5e89ac6a3f213f9f990142</id>
<content type='text'>
It can be enabled with -DUSE_EPHEMERON_POOL.

This variant uses the ephemeron pool and hence sovles the key-in-value
problem.

This version stores key/values pairs a vector-of-pairs instead of a
pair-of-vectors.  The same vector-of-pairs type is used for weak and
non-weak.  This avoids the code duplication used by the pair-of-vector
version; though it adds a bit of overhead to the non-weak code path.

* src/lisp.h: (struct vector_pair [!USE_EPHEMERON_POOL]): New type.
(struct pair_vector [USE_EPHEMERON_POOL]):New type.
(hash_table_kv): New typedef used to both version.
(hash_table_kv_create, hash_table_kv_free, hash_table_kv_key)
(hash_table_kv_value, hash_table_kv_set_key, hash_table_kv_set_value)
(hash_table_kv_null): New helpers
(struct Lisp_Hash_Table): Use a single field kv of type hash_table_kv
instead of two fields.
(HASH_KEY, HASH_VALUE, WEAK_HASH_KEY, WEAK_HASH_VALUE, DOHASH)
(DOHASH_WEAK, set_hash_key_slot, set_hash_value_slot)
(set_weak_hash_key_slot, set_weak_hash_value_slot): Adapt to
hash_table_kv.
(DOHASH [USE_EPHEMERON_POOL]): New version.
* src/igc.h (enum igc_obj_type): Add IGC_OBJ_PAIR_VECTOR,
IGC_OBJ_WEAK_KEY_PAIR_VECTOR, IGC_OBJ_WEAK_VALUE_PAIR_VECTOR,
IGC_OBJ_WEAK_OR_PAIR_VECTOR.
(igc_alloc_pair_vector): New prototype.
* src/igc.c (obj_type_names, set_header, dflt_scan_obj, thread_ap):
Handle new tpes.
(struct igc_thread, create_ephemeron_ap, create_thread_aps)
(igc_thread_remove): Add allocation point for ephemeron pool.
(struct igc, make_pool_aeph, make_igc): Add ephemeron pool.
(as_igc_header, fix_pair_vector, decode_ptr, encode_ptr)
(increment_ndeleted, splat_pair, fix_weak_key_pair, fix_weak_value_pair)
(fix_weak_or_pair, fix_weak_and_pair, scan_pair_vector)
(fix_weak_key_pair_vector, fix_weak_value_pair_vector)
(fix_weak_or_pair_vector, fix_weak_and_pair_vector): New helpers.
(fix_hash_table, fix_weak_hash_table_strong_part)
(fix_weak_hash_table_weak_part): Adapt to hash_table_kv.
(igc_alloc_pair_vector): New function.
* src/fns.c (maybe_resize_hash_table): Call maybe_resize_hash_table.
(Fgethash): Add assertion for HASH_UNUSED_ENTRY_KEY.
(Fhash_table_count): Take deleted entries into account.
(hash_table_kv_init, hash_table_kv_create)
(hash_table_kv_resize, hash_table_kv_free): New helpers.
(hash_table_kv_ndeleted, hash_table_ndeleted)
(hash_table_count, reclaim_deleted_entries)
(maybe_reclaim_deleted_entries): New helpers.
(make_hash_table, copy_hash_table, hash_table_thaw, hash_table_rehash)
(allocate_weak_hash_table_parts, make_weak_hash_table)
(maybe_resize_weak_hash_table): Adapt to hash_table_kv.
* src/alloc.c (cleanup_vector): Adapt to hash_table_kv.
* src/pdumper.c (hash_table_contents, hash_table_freeze)
(dump_hash_table): Adapt to hash_table_kv.
(dump_hash_table_kv_slot, dump_hash_table_kv, dump_hash_table_kv_part):
New helpers.
* src/print.c (print_object): Use Fhash_table_count instead
of the h-&gt;count field.
* test/src/fns-tests.el (ft--check-entries): Check hash-table-count.
(ft-weak-fixnums2, ft--test-weak-fixnums2): New test.
(ft--test-ephemeron-table): Better check for hash-table-count.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It can be enabled with -DUSE_EPHEMERON_POOL.

This variant uses the ephemeron pool and hence sovles the key-in-value
problem.

This version stores key/values pairs a vector-of-pairs instead of a
pair-of-vectors.  The same vector-of-pairs type is used for weak and
non-weak.  This avoids the code duplication used by the pair-of-vector
version; though it adds a bit of overhead to the non-weak code path.

* src/lisp.h: (struct vector_pair [!USE_EPHEMERON_POOL]): New type.
(struct pair_vector [USE_EPHEMERON_POOL]):New type.
(hash_table_kv): New typedef used to both version.
(hash_table_kv_create, hash_table_kv_free, hash_table_kv_key)
(hash_table_kv_value, hash_table_kv_set_key, hash_table_kv_set_value)
(hash_table_kv_null): New helpers
(struct Lisp_Hash_Table): Use a single field kv of type hash_table_kv
instead of two fields.
(HASH_KEY, HASH_VALUE, WEAK_HASH_KEY, WEAK_HASH_VALUE, DOHASH)
(DOHASH_WEAK, set_hash_key_slot, set_hash_value_slot)
(set_weak_hash_key_slot, set_weak_hash_value_slot): Adapt to
hash_table_kv.
(DOHASH [USE_EPHEMERON_POOL]): New version.
* src/igc.h (enum igc_obj_type): Add IGC_OBJ_PAIR_VECTOR,
IGC_OBJ_WEAK_KEY_PAIR_VECTOR, IGC_OBJ_WEAK_VALUE_PAIR_VECTOR,
IGC_OBJ_WEAK_OR_PAIR_VECTOR.
(igc_alloc_pair_vector): New prototype.
* src/igc.c (obj_type_names, set_header, dflt_scan_obj, thread_ap):
Handle new tpes.
(struct igc_thread, create_ephemeron_ap, create_thread_aps)
(igc_thread_remove): Add allocation point for ephemeron pool.
(struct igc, make_pool_aeph, make_igc): Add ephemeron pool.
(as_igc_header, fix_pair_vector, decode_ptr, encode_ptr)
(increment_ndeleted, splat_pair, fix_weak_key_pair, fix_weak_value_pair)
(fix_weak_or_pair, fix_weak_and_pair, scan_pair_vector)
(fix_weak_key_pair_vector, fix_weak_value_pair_vector)
(fix_weak_or_pair_vector, fix_weak_and_pair_vector): New helpers.
(fix_hash_table, fix_weak_hash_table_strong_part)
(fix_weak_hash_table_weak_part): Adapt to hash_table_kv.
(igc_alloc_pair_vector): New function.
* src/fns.c (maybe_resize_hash_table): Call maybe_resize_hash_table.
(Fgethash): Add assertion for HASH_UNUSED_ENTRY_KEY.
(Fhash_table_count): Take deleted entries into account.
(hash_table_kv_init, hash_table_kv_create)
(hash_table_kv_resize, hash_table_kv_free): New helpers.
(hash_table_kv_ndeleted, hash_table_ndeleted)
(hash_table_count, reclaim_deleted_entries)
(maybe_reclaim_deleted_entries): New helpers.
(make_hash_table, copy_hash_table, hash_table_thaw, hash_table_rehash)
(allocate_weak_hash_table_parts, make_weak_hash_table)
(maybe_resize_weak_hash_table): Adapt to hash_table_kv.
* src/alloc.c (cleanup_vector): Adapt to hash_table_kv.
* src/pdumper.c (hash_table_contents, hash_table_freeze)
(dump_hash_table): Adapt to hash_table_kv.
(dump_hash_table_kv_slot, dump_hash_table_kv, dump_hash_table_kv_part):
New helpers.
* src/print.c (print_object): Use Fhash_table_count instead
of the h-&gt;count field.
* test/src/fns-tests.el (ft--check-entries): Check hash-table-count.
(ft-weak-fixnums2, ft--test-weak-fixnums2): New test.
(ft--test-ephemeron-table): Better check for hash-table-count.
</pre>
</div>
</content>
</entry>
</feed>
