mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-06-14 12:31:25 +00:00
Make 'likely' macro available in all of Emacs (bug#81115)
* src/android.c (likely): Move ... * src/conf_post.h (likely): ... here. Ensure true values which aren't equal to 1 are still predicted correctly.
This commit is contained in:
parent
35f69be393
commit
0f6c382888
2 changed files with 5 additions and 2 deletions
|
|
@ -6158,8 +6158,6 @@ android_build_jstring (const char *text)
|
|||
if global_foo cannot be allocated, and after the global reference
|
||||
is created. */
|
||||
|
||||
#define likely(cond) __builtin_expect (cond, 1)
|
||||
|
||||
/* Check for JNI exceptions and call memory_full in that
|
||||
situation. */
|
||||
|
||||
|
|
|
|||
|
|
@ -371,6 +371,11 @@ extern int emacs_setenv_TZ (char const *);
|
|||
# define UNINIT /* empty */
|
||||
#endif
|
||||
|
||||
/* likely (COND) is equivalent to COND ? 1 : 0, but instructs the
|
||||
compiler to provide static branch prediction hints to the CPU so that
|
||||
the branch isn't mispredicted. */
|
||||
#define likely(cond) __builtin_expect (!!(cond), 1)
|
||||
|
||||
/* Emacs needs neither glibc strftime behavior for AM and PM indicators,
|
||||
nor Gnulib strftime support for non-Gregorian calendars. */
|
||||
#define REQUIRE_GNUISH_STRFTIME_AM_PM false
|
||||
|
|
|
|||
Loading…
Reference in a new issue