emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Excessive use of `eassert`


From: Stefan Monnier
Subject: Re: Excessive use of `eassert`
Date: Mon, 22 Jan 2024 08:20:13 -0500
User-agent: Gnus/5.13 (Gnus v5.13)

> Thanks, I reproduced that on Ubuntu 23.10 on x86-64 by configuring
> with --enable-checking and compiling with gcc -O0.

FWIW, I never compile with `-O0`, it's usually`-Og`.
And on i386 I saw it with `-O2` as well :-(

> +/* Equivalent to "make_lisp_symbol (&lispsym[INDEX])",
> +   and typically faster when compiling without optimization.  */
> +#define lisp_h_builtin_lisp_symbol(index) \
> +  TAG_PTR (Lisp_Symbol, (index) * sizeof *lispsym)
[...]
> +(builtin_lisp_symbol) (int index)
>  {
> -  return make_lisp_symbol (&lispsym[index]);
> +  return lisp_h_builtin_lisp_symbol (index);
>  }

Hmm... 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` (worse: the logic is actually not the same, so it's
not obvious that it ends up returning the same thing).


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]