]> git.eshelyaron.com Git - emacs.git/commit
Document and verify that emacs_limb_t doesn’t have padding bits.
authorPhilipp Stephani <phst@google.com>
Mon, 23 Dec 2019 14:37:49 +0000 (15:37 +0100)
committerPhilipp Stephani <phst@google.com>
Mon, 23 Dec 2019 14:37:49 +0000 (15:37 +0100)
commitf8e83d73a259e1809020d47e920a96a1f5803f7a
treeae5f8b17390a1090253025d69672f0eca52c5f28
parent0abdb01be6c1adee1f179b1d5f7a9fb4ee670109
Document and verify that emacs_limb_t doesn’t have padding bits.

This is a useful property when doing further bit-twiddling with the
magnitude array before/after calling extract_big_integer or
make_big_integer.  For example, constructing an emacs_limb_t object
using repeated shift-and-add should work as expected, but relies on
the type not having padding bits.  Since the C standard already
guarantees that unsigned integers use a pure binary representation,
not having padding bits is enough to guarantee that the type has
unique object representations in the sense of C++’s
std::has_unique_object_representations.

* doc/lispref/internals.texi (Module Values): Document that
emacs_limb_t doesn’t have padding bits.

* src/emacs-module.c: Verify that emacs_limb_t doesn’t have padding
bits.
doc/lispref/internals.texi
src/emacs-module.c