]> git.eshelyaron.com Git - emacs.git/commit
Turn specpdl_ref into a type of its own
authorMattias Engdegård <mattiase@acm.org>
Wed, 2 Feb 2022 15:51:43 +0000 (16:51 +0100)
committerMattias Engdegård <mattiase@acm.org>
Sat, 12 Feb 2022 17:18:58 +0000 (18:18 +0100)
commit297520852f4f0e11a34a8a867c13fdf03d83eafd
tree590f2992b2000c3c4945d8b908a3974848fce636
parenta8245e122075175df2f124b20e9e5b1b583eff89
Turn specpdl_ref into a type of its own

Wrap the specpdl_ref contents in a struct, which gives us some very
useful type checking to make sure that all code that assumed integral
specpdl refs has been converted.

We only do this on 64-bit platforms, since those tend to have modern
ABIs where small structs are optimised as scalars.  In other words,
this change should not affect the compiled code.

* src/lisp.h (specpdl_ref): Now a struct on 64-bit platforms.
(wrap_specpdl_ref, unwrap_specpdl_ref): New.
(specpdl_count_to_ref, specpdl_ref_to_count)
(specpdl_ref_eq, specpdl_ref_lt)
(specpdl_ref_valid_p, make_invalid_specpdl_ref): Use new wrappers.
src/lisp.h