diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-06-12 00:32:32 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-06-12 00:32:32 +0000 |
commit | df3e3768e98b6bc60e8f0297c80ad7d8696e6a1e (patch) | |
tree | c6d3c0340d816b951abd62fc53ffe1482eafba99 | |
parent | 465b0d49d637850a7a22732e541b06295f430cee (diff) |
* atomic.h (ATOMIC_OR): _InterlockedOr is not available on migw.
* gc.c (rb_gc_set_params): VM_OBJSPACE is disabled on mignw.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32018 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | atomic.h | 6 | ||||
-rw-r--r-- | gc.c | 9 | ||||
-rw-r--r-- | thread_win32.c | 1 |
4 files changed, 21 insertions, 1 deletions
@@ -1,3 +1,9 @@ +Sun Jun 12 09:32:13 2011 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * 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@dotrb.org> * ext/date/date_core.c: edited doc. @@ -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 @@ -83,7 +83,9 @@ void *alloca (); #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 @@ rb_objspace_free(rb_objspace_t *objspace) } free(objspace); } +#else +void +rb_gc_set_params(void) +{ +} #endif /* tiny heap size */ @@ -1091,6 +1098,7 @@ init_heap(rb_objspace_t *objspace) 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 @@ initial_expand_heap(rb_objspace_t *objspace) add_heap_slots(objspace, add); } } +#endif static void set_heaps_increment(rb_objspace_t *objspace) diff --git a/thread_win32.c b/thread_win32.c index 13cbbffbef..694b1e1f87 100644 --- a/thread_win32.c +++ b/thread_win32.c @@ -532,7 +532,6 @@ native_cond_timeout(rb_thread_cond_t *cond, struct timespec timeout_rel) 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; |