]> git.eshelyaron.com Git - emacs.git/commit
Allow zero hash table size
authorMattias Engdegård <mattiase@acm.org>
Sat, 4 Nov 2023 14:16:38 +0000 (15:16 +0100)
committerMattias Engdegård <mattiase@acm.org>
Sat, 13 Jan 2024 19:50:38 +0000 (20:50 +0100)
commit49fd4d120deb0b878ad262aea7d849c7275bc12c
tree24c0547020d3283722b610fe5b13ae10f95c8524
parentd3cefd3e98354929d96c9396e5920e8a123784dc
Allow zero hash table size

This avoids any extra allocation for such vectors, including empty
tables read by the Lisp reader, and provides extra safety essentially
for free.

* src/fns.c (make_hash_table): Allow tables to be 0-sized.  The index
will always have at least one entry, to avoid extra look-up costs.
* src/alloc.c (process_mark_stack): Don't mark pure objects,
because empty vectors are pure.
src/alloc.c
src/fns.c
src/lisp.h