[Top][All Lists]

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

Re: Using __builtin_expect (likely/unlikely macros)

From: Alex Gramiak
Subject: Re: Using __builtin_expect (likely/unlikely macros)
Date: Mon, 15 Apr 2019 23:33:51 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux)

Eli Zaretskii <address@hidden> writes:

> I'm not sure whether you put LIKELY and UNLIKELY somewhat randomly,
> just for testing, or did you really think each place is
> likely/unlikely as in the change, but at least some places in xdisp.c
> are wrong: they use LIKELY where UNLIKELY is more appropriate, abd
> vice versa.

Out of curiosity, which places would that be? I only put UNLIKELY calls
around the checks for emacs_abort (which I presume to be unlikely), and
the LIKELY calls are of the form:

  else if (LIKELY (<cond>))
    emacs_abort ();

So if already at the "else if" clause, it's likely that the condition is
true, otherwise an abort would take place.

reply via email to

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