1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
tarui 2010-06-24 16:11:05 +00:00
parent f5ea2822e6
commit 12c2e07a3d
2 changed files with 11 additions and 0 deletions

View file

@ -1,3 +1,8 @@
Fri Jun 25 01:07:17 2010 Masaya Tarui <tarui@ruby-lnag.org>
* include/ruby/ruby.h (static inline rb_gc_guarded_ptr): prevent
RB_GC_GUARD_PTR being removed by optimization.
Thu Jun 24 06:22:27 2010 Tanaka Akira <akr@fsij.org>
* ext/socket/raddrinfo.c (ruby_getaddrinfo__darwin): the workaround

View file

@ -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)))