[前][次][番号順一覧][スレッド一覧]

ruby-changes:28743

From: nobu <ko1@a...>
Date: Fri, 17 May 2013 17:35:37 +0900 (JST)
Subject: [ruby-changes:28743] nobu:r40795 (trunk): gc.c: rb_gc_guarded_ptr

nobu	2013-05-17 17:35:26 +0900 (Fri, 17 May 2013)

  New Revision: 40795

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=40795

  Log:
    gc.c: rb_gc_guarded_ptr
    
    * gc.c (rb_gc_guarded_ptr): unoptimize on other compilers than gcc and
      msvc.

  Modified files:
    trunk/ChangeLog
    trunk/gc.c
    trunk/include/ruby/ruby.h

Index: include/ruby/ruby.h
===================================================================
--- include/ruby/ruby.h	(revision 40794)
+++ include/ruby/ruby.h	(revision 40795)
@@ -506,10 +506,11 @@ static inline int rb_type(VALUE obj); https://github.com/ruby/ruby/blob/trunk/include/ruby/ruby.h#L506
 #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)
+#else
+volatile VALUE *rb_gc_guarded_ptr(volatile VALUE *ptr);
+#define HAVE_RB_GC_GUARDED_PTR 1
 #endif
 #define RB_GC_GUARD_PTR(ptr) rb_gc_guarded_ptr(ptr)
 #endif
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 40794)
+++ ChangeLog	(revision 40795)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Fri May 17 17:34:48 2013  Nobuyoshi Nakada  <nobu@r...>
+
+	* gc.c (rb_gc_guarded_ptr): unoptimize on other compilers than gcc and
+	  msvc.
+
 Fri May 17 11:06:48 2013  Nobuyoshi Nakada  <nobu@r...>
 
 	* eval_intern.h (TH_PUSH_TAG): ensure jmpbuf to be accessible before
Index: gc.c
===================================================================
--- gc.c	(revision 40794)
+++ gc.c	(revision 40795)
@@ -67,6 +67,14 @@ https://github.com/ruby/ruby/blob/trunk/gc.c#L67
 #define rb_setjmp(env) RUBY_SETJMP(env)
 #define rb_jmp_buf rb_jmpbuf_t
 
+#if defined(HAVE_RB_GC_GUARDED_PTR) && HAVE_RB_GC_GUARDED_PTR
+volatile VALUE *
+rb_gc_guarded_ptr(volatile VALUE *ptr)
+{
+    return ptr;
+}
+#endif
+
 #ifndef GC_MALLOC_LIMIT
 #define GC_MALLOC_LIMIT 8000000
 #endif

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]