diff options
author | tarui <tarui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-06-24 16:11:05 +0000 |
---|---|---|
committer | tarui <tarui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-06-24 16:11:05 +0000 |
commit | 12c2e07a3de52d139baf206b215ead95861c7da8 (patch) | |
tree | 895802036aaa42f065cafd63fb275d7fd22f87e8 /include | |
parent | f5ea2822e6aab93b2b9a4f52d27f059dc4a9c43e (diff) | |
download | ruby-12c2e07a3de52d139baf206b215ead95861c7da8.tar.gz |
* include/ruby/ruby.h (static inline rb_gc_guarded_ptr): prevent
RB_GC_GUARD_PTR being removed by optimization.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28423 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'include')
-rw-r--r-- | include/ruby/ruby.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h index 37c3e47e40..d4ffe10d8c 100644 --- a/include/ruby/ruby.h +++ b/include/ruby/ruby.h @@ -420,7 +420,13 @@ 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 +#ifdef _MSC_VER +#pragma optimize("", off) +#endif static inline volatile VALUE *rb_gc_guarded_ptr(volatile VALUE *ptr) {return ptr;} +#ifdef _MSC_VER +#pragma optimize("", on) +#endif #define RB_GC_GUARD_PTR(ptr) rb_gc_guarded_ptr(ptr) #endif #define RB_GC_GUARD(v) (*RB_GC_GUARD_PTR(&(v))) |