ruby-changes:13518
From: nobu <ko1@a...>
Date: Sun, 11 Oct 2009 09:04:55 +0900 (JST)
Subject: [ruby-changes:13518] Ruby:r25294 (trunk): * include/ruby/ruby.h (RB_GC_GUARD_PTR): workaround for gcc
nobu 2009-10-11 09:04:10 +0900 (Sun, 11 Oct 2009) New Revision: 25294 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=25294 Log: * include/ruby/ruby.h (RB_GC_GUARD_PTR): workaround for gcc optimization. Modified files: trunk/ChangeLog trunk/include/ruby/ruby.h Index: include/ruby/ruby.h =================================================================== --- include/ruby/ruby.h (revision 25293) +++ include/ruby/ruby.h (revision 25294) @@ -387,7 +387,13 @@ static inline int rb_type(VALUE obj); #define TYPE(x) rb_type((VALUE)(x)) -#define RB_GC_GUARD(v) (*(volatile VALUE *)&(v)) +#ifdef __GNUC__ +#define RB_GC_GUARD_PTR(ptr) \ + __extension__ ({volatile VALUE *rb_gc_guarded_ptr = (ptr); rb_gc_guarded_ptr;}) +#else +#define RB_GC_GUARD_PTR(ptr) (volatile VALUE *)(ptr) +#endif +#define RB_GC_GUARD(v) (*RB_GC_GUARD_PTR(&(v))) void rb_check_type(VALUE,int); #define Check_Type(v,t) rb_check_type((VALUE)(v),t) Index: ChangeLog =================================================================== --- ChangeLog (revision 25293) +++ ChangeLog (revision 25294) @@ -1,5 +1,8 @@ -Sun Oct 11 08:48:14 2009 Nobuyoshi Nakada <nobu@r...> +Sun Oct 11 09:04:08 2009 Nobuyoshi Nakada <nobu@r...> + * include/ruby/ruby.h (RB_GC_GUARD_PTR): workaround for gcc + optimization. + * include/ruby/ruby.h (ruby_exec_node): declared. Sun Oct 11 03:10:50 2009 NARUSE, Yui <naruse@r...> -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/