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

ruby-changes:42084

From: nobu <ko1@a...>
Date: Thu, 17 Mar 2016 22:21:43 +0900 (JST)
Subject: [ruby-changes:42084] nobu:r54158 (trunk): ruby.h: remove RB_GC_GUARD_PTR

nobu	2016-03-17 22:21:36 +0900 (Thu, 17 Mar 2016)

  New Revision: 54158

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

  Log:
    ruby.h: remove RB_GC_GUARD_PTR
    
    * include/ruby/ruby.h (RB_GC_GUARD_PTR): remove intermediate
      macro, and expand for each RB_GC_GUARD.  [Fix GH-1293]

  Modified files:
    trunk/ChangeLog
    trunk/include/ruby/ruby.h
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 54157)
+++ ChangeLog	(revision 54158)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Thu Mar 17 22:21:34 2016  Nobuyoshi Nakada  <nobu@r...>
+
+	* include/ruby/ruby.h (RB_GC_GUARD_PTR): remove intermediate
+	  macro, and expand for each RB_GC_GUARD.  [Fix GH-1293]
+
 Thu Mar 17 22:08:33 2016  Nobuyoshi Nakada  <nobu@r...>
 
 	* compile.c (iseq_specialized_instruction): move specialization
Index: include/ruby/ruby.h
===================================================================
--- include/ruby/ruby.h	(revision 54157)
+++ include/ruby/ruby.h	(revision 54158)
@@ -551,27 +551,19 @@ static inline int rb_type(VALUE obj); https://github.com/ruby/ruby/blob/trunk/include/ruby/ruby.h#L551
 	((type) == RUBY_T_FLOAT) ? RB_FLOAT_TYPE_P(obj) : \
 	(!RB_SPECIAL_CONST_P(obj) && RB_BUILTIN_TYPE(obj) == (type)))
 
-/* RB_GC_GUARD_PTR() is an intermediate macro, and has no effect by
- * itself.  don't use it directly */
 #ifdef __GNUC__
-#define RB_GC_GUARD_PTR(ptr) \
-    __extension__ ({volatile VALUE *rb_gc_guarded_ptr = (ptr); rb_gc_guarded_ptr;})
-#else
-#ifdef _MSC_VER
+#define RB_GC_GUARD(v) \
+    (*__extension__ ({volatile VALUE *rb_gc_guarded_ptr = &(v); rb_gc_guarded_ptr;}))
+#elif defined _MSC_VER
 #pragma optimize("", off)
 static inline volatile VALUE *rb_gc_guarded_ptr(volatile VALUE *ptr) {return ptr;}
 #pragma optimize("", on)
+#define RB_GC_GUARD(v) (*rb_gc_guarded_ptr(&(v)))
 #else
 volatile VALUE *rb_gc_guarded_ptr_val(volatile VALUE *ptr, VALUE val);
 #define HAVE_RB_GC_GUARDED_PTR_VAL 1
 #define RB_GC_GUARD(v) (*rb_gc_guarded_ptr_val(&(v),(v)))
 #endif
-#define RB_GC_GUARD_PTR(ptr) rb_gc_guarded_ptr(ptr)
-#endif
-
-#ifndef RB_GC_GUARD
-#define RB_GC_GUARD(v) (*RB_GC_GUARD_PTR(&(v)))
-#endif
 
 #ifdef __GNUC__
 #define RB_UNUSED_VAR(x) x __attribute__ ((unused))

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

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