ruby-changes:60839
From: Nobuyoshi <ko1@a...>
Date: Mon, 20 Apr 2020 21:15:23 +0900 (JST)
Subject: [ruby-changes:60839] e571bb8436 (master): Removed phony atomic operations for void* and VALUE
https://git.ruby-lang.org/ruby.git/commit/?id=e571bb8436 From e571bb8436502b1bce54a1e41c40ef682e05c555 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Mon, 20 Apr 2020 21:13:08 +0900 Subject: Removed phony atomic operations for void* and VALUE diff --git a/ruby_atomic.h b/ruby_atomic.h index d233867..0742791 100644 --- a/ruby_atomic.h +++ b/ruby_atomic.h @@ -162,14 +162,7 @@ typedef unsigned int rb_atomic_t; https://github.com/ruby/ruby/blob/trunk/ruby_atomic.h#L162 # if SIZEOF_VOIDP == SIZEOF_SIZE_T # define ATOMIC_PTR_EXCHANGE(var, val) (void *)ATOMIC_SIZE_EXCHANGE(*(size_t *)&(var), (size_t)(val)) # else -# define ATOMIC_PTR_EXCHANGE(var, val) ruby_atomic_ptr_exchange((const void **)&(var), (val)) -static inline void * -ruby_atomic_ptr_exchange(const void **ptr, const void *val) -{ - const void *const old = *ptr; - *ptr = val; - return (void *)old; -} +# error No atomic exchange for void* # endif #endif @@ -177,14 +170,7 @@ ruby_atomic_ptr_exchange(const void **ptr, const void *val) https://github.com/ruby/ruby/blob/trunk/ruby_atomic.h#L170 # if SIZEOF_VOIDP == SIZEOF_SIZE_T # define ATOMIC_PTR_CAS(var, oldval, val) (void *)ATOMIC_SIZE_CAS(*(size_t *)&(var), (size_t)(oldval), (size_t)(val)) # else -# define ATOMIC_PTR_CAS(var, oldval, val) ruby_atomic_ptr_cas(&(var), (oldval), (val)) -static inline void * -ruby_atomic_ptr_cas(const void **ptr, const void *oldval, const void *val) -{ - const void *const old = *ptr; - if (old == oldval) *ptr = val; - return (void *)old; -} +# error No atomic compare-and-set for void* # endif #endif @@ -192,14 +178,7 @@ ruby_atomic_ptr_cas(const void **ptr, const void *oldval, const void *val) https://github.com/ruby/ruby/blob/trunk/ruby_atomic.h#L178 # if SIZEOF_VALUE == SIZEOF_SIZE_T # define ATOMIC_VALUE_EXCHANGE(var, val) ATOMIC_SIZE_EXCHANGE(*(size_t *)&(var), (size_t)(val)) # else -# define ATOMIC_VALUE_EXCHANGE(var, val) ruby_atomic_value_exchange(&(var), (val)) -static inline VALUE -ruby_atomic_value_exchange(VALUE *ptr, VALUE val) -{ - const VALUE old = *ptr; - *ptr = val; - return old; -} +# error No atomic exchange for VALUE # endif #endif @@ -207,14 +186,7 @@ ruby_atomic_value_exchange(VALUE *ptr, VALUE val) https://github.com/ruby/ruby/blob/trunk/ruby_atomic.h#L186 # if SIZEOF_VALUE == SIZEOF_SIZE_T # define ATOMIC_VALUE_CAS(var, oldval, val) ATOMIC_SIZE_CAS(*(size_t *)&(var), (size_t)(oldval), (size_t)(val)) # else -# define ATOMIC_VALUE_CAS(var, oldval, val) ruby_atomic_value_cas(&(var), (oldval), (val)) -static inline VALUE -ruby_atomic_value_cas(VALUE *ptr, VALUE oldval, VALUE val) -{ - const VALUE old = *ptr; - if (old == oldval) *ptr = val; - return old; -} +# error No atomic compare-and-set for VALUE # endif #endif diff --git a/tool/sync_default_gems.rb b/tool/sync_default_gems.rb index d034e72..ddbce8d 100644 --- a/tool/sync_default_gems.rb +++ b/tool/sync_default_gems.rb @@ -374,11 +374,15 @@ def sync_default_gems_with_commits(gem, range) https://github.com/ruby/ruby/blob/trunk/tool/sync_default_gems.rb#L374 if result.empty? skipped = true - elsif result.start_with?("CONFLICT") + elsif /^CONFLICT/ =~ result result = IO.popen(%W"git status --porcelain", &:readlines).each(&:chomp!) - ignore = result.map {|line| /^DU / =~ line and IGNORE_FILE_PATTERN =~ (name = $') and name} + ignore = result.map {|line| /^.U / =~ line and IGNORE_FILE_PATTERN =~ (name = $') and name} ignore.compact! - system(*%W"git reset", *ignore) unless ignore.empty? + warn "Resetting #{ignore}" + unless ignore.empty? + system(*%W"git reset HEAD --", *ignore) + system(*%W"git checkout HEAD --", *ignore) + end skipped = !system({"GIT_EDITOR"=>"true"}, *%W"git cherry-pick --no-edit --continue") end -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/