diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | include/ruby/ruby.h | 3 |
2 files changed, 7 insertions, 1 deletions
@@ -1,3 +1,8 @@ +Sun May 9 23:53:14 2010 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * include/ruby/ruby.h (RB_GC_GUARD_PTR): get rid of removal by + optimization. + Sun May 9 23:07:53 2010 Yusuke Endoh <mame@tsg.ne.jp> * proc.c (proc_dup): copy blockprocval. proc_dup is used by diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h index a9fd974614..edfa3f41a1 100644 --- a/include/ruby/ruby.h +++ b/include/ruby/ruby.h @@ -420,7 +420,8 @@ static inline int rb_type(VALUE obj); #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) +static inline volatile VALUE *rb_gc_guarded_ptr(volatile VALUE *ptr) {return ptr;} +#define RB_GC_GUARD_PTR(ptr) rb_gc_guarded_ptr(ptr) #endif #define RB_GC_GUARD(v) (*RB_GC_GUARD_PTR(&(v))) |