[前][次][番号順一覧][スレッド一覧]

ruby-changes:42652

From: naruse <ko1@a...>
Date: Sat, 23 Apr 2016 15:18:50 +0900 (JST)
Subject: [ruby-changes:42652] naruse:r54727 (trunk): * include/ruby/ruby.h (rb_mul_size_overflow): use UNLIKELY

naruse	2016-04-23 16:15:26 +0900 (Sat, 23 Apr 2016)

  New Revision: 54727

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=54727

  Log:
    * include/ruby/ruby.h (rb_mul_size_overflow): use UNLIKELY
      by user side to improve generallity.

  Modified files:
    trunk/ChangeLog
    trunk/include/ruby/ruby.h
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 54726)
+++ ChangeLog	(revision 54727)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sat Apr 23 16:11:39 2016  NARUSE, Yui  <naruse@r...>
+
+	* include/ruby/ruby.h (rb_mul_size_overflow): use UNLIKELY
+	  by user side to improve generallity.
+
 Sat Apr 23 16:10:02 2016  NARUSE, Yui  <naruse@r...>
 
 	* include/ruby/ruby.h (RB_LIKELY): use prefix in ruby.h.
Index: include/ruby/ruby.h
===================================================================
--- include/ruby/ruby.h	(revision 54726)
+++ include/ruby/ruby.h	(revision 54727)
@@ -1628,10 +1628,10 @@ rb_mul_size_overflow(size_t a, size_t b, https://github.com/ruby/ruby/blob/trunk/include/ruby/ruby.h#L1628
 {
 #ifdef DSIZE_T
     DSIZE_T c2 = (DSIZE_T)a * (DSIZE_T)b;
-    if (RB_UNLIKELY(c2 > max)) return 1;
+    if (c2 > max) return 1;
     *c = (size_t)c2;
 #else
-    if (b != 0 && RB_UNLIKELY(a > max / b)) return 1;
+    if (b != 0 && a > max / b) return 1;
     *c = a * b;
 #endif
     return 0;

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]