|
| From: | Paul Eggert |
| Subject: | Re: Excessive use of `eassert` |
| Date: | Tue, 23 Jan 2024 00:15:03 -0800 |
| User-agent: | Mozilla Thunderbird |
On 2024-01-22 05:20, Stefan Monnier wrote:
Yes, when --enable-checking is used the tradeoff is: would we rather omit all runtime checking in make_lisp_symbol (the patch you proposed), or omit it only for builtin symbols (the patch I installed)?Compared to the patch I proposed this has the downside that it duplicates the logic between `lisp_h_builtin_lisp_symbol` and `make_lisp_symbol`
For builtin symbols like Qnil and Qt the runtime checking is not all that useful - if these symbols' data items are improperly aligned Emacs will crash early anyway. For non-builtin symbols the runtime checking is arguably useful, to catch (presumably rare) alignment bugs in the memory allocator.
If you'd rather have the simpler solution that doesn't catch alignment bugs in non-builtin symbols, I could prepare a patch along those lines. Any such alignment bugs are pretty unlikely, after all.
(worse: the logic is actually not the same, so it'snot obvious that it ends up returning the same thing).
I used that logic to convince gcc to optimize builtin symbols like Qt and Qnil into integer constants at the machine level even when -O0 is used. But if nobody needs that sort of performance with -O0, we could go back to the old way of doing things. (It's obvious to *me* that the two formulations are equivalent but hey! only four people in the world understand lisp.h and nobody knows which four people they are....)
| [Prev in Thread] | Current Thread | [Next in Thread] |