mirror of
https://github.com/ruby/ruby.git
synced 2025-08-24 13:34:17 +02:00
ruby.h: ASSUME
* include/ruby/ruby.h (ASSUME): hint for optimization, the expression is assumed to be true always. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51342 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
c44360f623
commit
4c4d0389f5
2 changed files with 9 additions and 1 deletions
|
@ -41,8 +41,15 @@ extern "C" {
|
|||
#ifndef NOINLINE
|
||||
# define NOINLINE(x) x
|
||||
#endif
|
||||
#ifndef ASSUME
|
||||
# ifdef UNREACHABLE
|
||||
# define ASSUME(x) (LIKELY(!!(x)) ? (void)0 : UNREACHABLE)
|
||||
# else
|
||||
# define ASSUME(x) ((void)0)
|
||||
# endif
|
||||
#endif
|
||||
#ifndef UNREACHABLE
|
||||
# define UNREACHABLE /* unreachable */
|
||||
# define UNREACHABLE ((void)0) /* unreachable */
|
||||
#endif
|
||||
|
||||
#ifdef __GNUC__
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue