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

ruby-changes:19971

From: nobu <ko1@a...>
Date: Sun, 12 Jun 2011 09:32:50 +0900 (JST)
Subject: [ruby-changes:19971] nobu:r32018 (trunk): * atomic.h (ATOMIC_OR): _InterlockedOr is not available on migw.

nobu	2011-06-12 09:32:32 +0900 (Sun, 12 Jun 2011)

  New Revision: 32018

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

  Log:
    * atomic.h (ATOMIC_OR): _InterlockedOr is not available on migw.
    * gc.c (rb_gc_set_params): VM_OBJSPACE is disabled on mignw.

  Modified files:
    trunk/ChangeLog
    trunk/atomic.h
    trunk/gc.c
    trunk/thread_win32.c

Index: thread_win32.c
===================================================================
--- thread_win32.c	(revision 32017)
+++ thread_win32.c	(revision 32018)
@@ -532,7 +532,6 @@
     now.tv_sec = tv.tv_sec;
     now.tv_nsec = tv.tv_usec * 1000;
 
-  out:
     timeout.tv_sec = now.tv_sec;
     timeout.tv_nsec = now.tv_nsec;
     timeout.tv_sec += timeout_rel.tv_sec;
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 32017)
+++ ChangeLog	(revision 32018)
@@ -1,3 +1,9 @@
+Sun Jun 12 09:32:13 2011  Nobuyoshi Nakada  <nobu@r...>
+
+	* atomic.h (ATOMIC_OR): _InterlockedOr is not available on migw.
+
+	* gc.c (rb_gc_set_params): VM_OBJSPACE is disabled on mignw.
+
 Sun Jun 12 01:07:09 2011  Tadayoshi Funaba  <tadf@d...>
 
 	* ext/date/date_core.c: edited doc.
Index: gc.c
===================================================================
--- gc.c	(revision 32017)
+++ gc.c	(revision 32018)
@@ -83,7 +83,9 @@
 #define FREE_MIN  4096
 
 static unsigned int initial_malloc_limit   = GC_MALLOC_LIMIT;
+#if defined(ENABLE_VM_OBJSPACE) && ENABLE_VM_OBJSPACE
 static unsigned int initial_heap_min_slots = HEAP_MIN_SLOTS;
+#endif
 static unsigned int initial_free_min       = FREE_MIN;
 
 #define nomem_error GET_VM()->special_exceptions[ruby_error_nomemory]
@@ -474,6 +476,11 @@
     }
     free(objspace);
 }
+#else
+void
+rb_gc_set_params(void)
+{
+}
 #endif
 
 /* tiny heap size */
@@ -1091,6 +1098,7 @@
     finalizer_table = st_init_numtable();
 }
 
+#if defined(ENABLE_VM_OBJSPACE) && ENABLE_VM_OBJSPACE
 static void
 initial_expand_heap(rb_objspace_t *objspace)
 {
@@ -1101,6 +1109,7 @@
         add_heap_slots(objspace, add);
     }
 }
+#endif
 
 static void
 set_heaps_increment(rb_objspace_t *objspace)
Index: atomic.h
===================================================================
--- atomic.h	(revision 32017)
+++ atomic.h	(revision 32018)
@@ -2,13 +2,19 @@
 #define RUBY_ATOMIC_H
 
 #ifdef _WIN32
+#ifdef _MSC_VER
 #pragma intrinsic(_InterlockedOr)
+#endif
 typedef LONG rb_atomic_t;
 
 # define ATOMIC_SET(var, val) InterlockedExchange(&(var), (val))
 # define ATOMIC_INC(var) InterlockedIncrement(&(var))
 # define ATOMIC_DEC(var) InterlockedDecrement(&(var))
+#if defined __GNUC__
+# define ATOMIC_OR(var, val) __asm__("lock\n\t" "orl\t%1, %0" : "=m"(var) : "Ir"(val))
+#else
 # define ATOMIC_OR(var, val) _InterlockedOr(&(var), (val))
+#endif
 # define ATOMIC_EXCHANGE(var, val) InterlockedExchange(&(var), (val))
 
 #elif defined HAVE_GCC_ATOMIC_BUILTINS

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

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