aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--include/ruby/ruby.h6
2 files changed, 11 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index f3b53c2305..382f367cba 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
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)))