1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* include/ruby/ruby.h (LIKELY): moved from internal.h.

* include/ruby/ruby.h (UNLIKELY): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54662 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2016-04-21 20:59:39 +00:00
parent fe120ac1f1
commit 54c1f47930
3 changed files with 15 additions and 9 deletions

View file

@ -1,3 +1,9 @@
Fri Apr 22 04:54:40 2016 NARUSE, Yui <naruse@ruby-lang.org>
* include/ruby/ruby.h (LIKELY): moved from internal.h.
* include/ruby/ruby.h (UNLIKELY): ditto.
Thu Apr 21 01:44:19 2016 NARUSE, Yui <naruse@ruby-lang.org>
* gc.c (objspace_malloc_prepare): remove size check because it is

View file

@ -62,6 +62,15 @@ extern "C" {
# define UNREACHABLE ((void)0) /* unreachable */
#endif
/* likely */
#if __GNUC__ >= 3
#define LIKELY(x) (__builtin_expect(!!(x), 1))
#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
#else /* __GNUC__ >= 3 */
#define LIKELY(x) (x)
#define UNLIKELY(x) (x)
#endif /* __GNUC__ >= 3 */
#ifdef __GNUC__
#define PRINTF_ARGS(decl, string_index, first_to_check) \
decl __attribute__((format(printf, string_index, first_to_check)))

View file

@ -23,15 +23,6 @@ extern "C" {
#endif
#endif
/* likely */
#if __GNUC__ >= 3
#define LIKELY(x) (__builtin_expect(!!(x), 1))
#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
#else /* __GNUC__ >= 3 */
#define LIKELY(x) (x)
#define UNLIKELY(x) (x)
#endif /* __GNUC__ >= 3 */
#ifndef __has_attribute
# define __has_attribute(x) 0
#endif