]> 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)
committerEshel Yaron <me@eshelyaron.com>
Sun, 14 Jan 2024 15:15:39 +0000 (16:15 +0100)
commit8939b8f18112bd5caa064f000f86d5281c1a75fb
tree2eff240564f83f05452375d199184f6732b343bc
parent19a3cbe0eb8609d99335e02ee4780756efdbc36b
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.

(cherry picked from commit 49fd4d120deb0b878ad262aea7d849c7275bc12c)
src/alloc.c
src/fns.c
src/lisp.h