summaryrefslogtreecommitdiff
path: root/ruby_atomic.h
Commit message (Collapse)AuthorAgeFilesLines
* Solaris does not provide atomic_sub familyNobuyoshi Nakada2020-04-261-1/+1
|
* Clarified return value of atomic macrosNobuyoshi Nakada2020-04-261-13/+56
|
* Removed phony atomic operations for void* and VALUENobuyoshi Nakada2020-04-201-32/+4
|
* Bail out if no atomic operation foundNobuyoshi Nakada2020-04-201-24/+1
| | | | | As atomic operations are mandatory now, not-working phony fallback definitions are not only useless but confusing and harmful.
* fine-grained #ifdef guard for Sparc systems卜部昌平2020-02-061-1/+1
| | | | | | | | | There are cases when sizeof(int) == sizeof(long) == sizeof(size_t). On such cases however int and long are incompatible types in theory. We should not assume typedef long size_t, because on Solaris size_t is actually a typedef of int. This reduces compiler warnings on such situations.
* add several __has_something macro卜部昌平2019-12-261-3/+3
| | | | | | | With these macros implemented we can write codes just like we can assume the compiler being clang. MSC_VERSION_SINCE is defined to implement those macros, but turned out to be handy for other places. The -fdeclspec compiler flag is necessary for clang to properly handle __has_declspec().
* move atomic logic from mjit.c from ruby_atomic.hshyouhei2018-08-011-0/+4
| | | | | | | This macro shall be shared among other files, not just for mjit.c. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* (cosmetic) add blank lines for better readabilityshyouhei2018-08-011-0/+7
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* statement experssion is a GCCismshyouhei2018-01-021-3/+3
| | | | | | should mark as such. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61557 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Revert r52995nobu2015-12-091-5/+0
| | | | | | revert slow atomic operations. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52997 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* use atomic operationsnobu2015-12-091-0/+5
| | | | | | | | | * regcomp.c (onig_chain_link_add): use atomic operation instead of mutex. * regint.h (ONIG_STATE_{INC,DEC}_THREAD): ditto. * regparse.c (PopFreeNode, node_recycle): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52995 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby_atomic.h: fix old value type of ATOMIC_CASnobu2015-12-051-1/+1
| | | | | | | | * ruby_atomic.h (ATOMIC_CAS): old value to be swapped should be same as the destination. immediate value may need type promotion. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52893 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby_atomic.h: fix the argument ordernobu2015-12-051-1/+1
| | | | | | | | * ruby_atomic.h (ATOMIC_SIZE_CAS): fix the argument order of InterlockedCompareExchange64. new value and then old value is the last. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52892 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby_atomic.h: fix typonobu2015-09-071-1/+1
| | | | | | | * ruby_atomic.h (ATOMIC_VALUE_CAS): fix typo. TODO: make arguments of all CAS macros consistent. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51781 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby_atomic.h: atomic VALUE operationsnobu2015-08-061-6/+67
| | | | | | | * ruby_atomic.h (ATOMIC_VALUE_EXCHANGE, ATOMIC_VALUE_CAS): add atomic operations for VALUE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51498 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby_atomic.h: refine ATOMIC_PTR_CASnobu2015-06-211-0/+2
| | | | | | | * ruby_atomic.h (ATOMIC_PTR_CAS): define by generic CAS macro, not via size_t, to suppress a warning by mingw gcc. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby_atomic.h (ATOMIC_OR): should return previous valuenobu2014-10-191-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48036 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* iseq.c: potential memory leaknobu2014-01-121-0/+5
| | | | | | | * iseq.c (iseq_load): keep type_map to get rid of memory leak. based on a patch by Eric Wong at [ruby-core:59699]. [Bug #9399] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44568 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby_atomic.h: ATOMIC_PTR_EXCHANGEnobu2013-12-051-0/+10
| | | | | | | * ruby_atomic.h (ATOMIC_PTR_EXCHANGE): atomic exchange function for a generic pointer. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43996 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby_atomic.h: duplicate codenobu2013-12-051-4/+0
| | | | | | | * ruby_atomic.h (ATOMIC_SIZE_CAS): remove duplicate code as ATOMIC_CAS(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43995 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby_atomic.h: remove duplicate definisions between ATOMIC_XXXglass2013-11-271-8/+9
| | | | | | and ATOMIC_SIZE_XXX. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43883 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby_atomic.h: define ATOMIC_SIZE_CAS() withglass2013-11-271-5/+7
| | | | | | __atomic_compare_exchange_n() and refactoring. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43882 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby_atomic.h: use __atomic builtin functions supported by GCC.glass2013-11-261-0/+20
| | | | | | | | | | __sync family are legacy functions now and it is recommended that new code use the __atomic functions. http://gcc.gnu.org/onlinedocs/gcc/_005f_005fatomic-Builtins.html * configure.in: check existence of __atomic functions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43851 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby_atomic.h (ATOMIC_SIZE_CAS): fix compile error on Solaris since r43460.ngoto2013-11-141-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43677 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby_atomic.h: ATOMIC_SIZE_CASnobu2013-10-291-0/+6
| | | | | | * ruby_atomic.h (ATOMIC_SIZE_CAS): new macro, compare and swap size_t. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43460 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby_atomic.h: suppress a warningnobu2013-10-181-3/+3
| | | | | | * ruby_atomic.h (ATOMIC_SIZE_SUB): add cast to suppress a warning by VC++. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43356 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby_atomic.h: ATOMIC_CAS on VC6nobu2013-07-031-2/+2
| | | | | | | | * ruby_atomic.h (rb_w32_atomic_cas): call InterlockedCompareExchange directly. * ruby_atomic.h (ATOMIC_CAS): fix missing function call. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41760 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby_atomic.h: suppress warnignsnobu2013-07-031-0/+9
| | | | | | | * ruby_atomic.h (ATOMIC_CAS): suppress C4022 and C4047 warnings in VC6. only InterlockedCompareExchange is declared using PVOID. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41759 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * configure.in (AC_CHECK_HEADERS): atomic.h for Solaris atomic_ops.ngoto2013-04-061-1/+1
| | | | | | | * ruby_atomic.h: Skip using Solaris10 atomic_ops on Solaris 9 or earlier if atomic.h is not available. [ruby-dev:47229] [Bug #8228] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40163 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby_atomic.h (ATOMIC_CAS): added for Solaris and other platforms.ngoto2012-11-271-1/+6
| | | | | | | | | | | * ruby_atomic.h, signal.c (NEED_RUBY_ATOMIC_OPS): renamed from NEED_RUBY_ATOMIC_EXCHANGE. * signal.c (ruby_atomic_compare_and_swap): naive, non-atomic compare-and-swap implementation only used for platforms without valid support for atomic operations. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37897 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby_atomic.h (ATOMIC_CAS): new macro for compare-and-exchange.kosaki2012-11-261-1/+2
| | | | | | | | | | | | | | | | | | | | | | | * vm_core.h (struct rb_thread_struct): add interrupt_mask member. * thread.c (thread_create_core, Init_Thread): initialize th->thread_mask. * vm_core.h (RUBY_VM_INTERRUPTED_ANY): new macro for avoiding bare th->interrupt_flag. * vm_core.h (RUBY_VM_INTERRUPTED, RUBY_VM_INTERRUPTED): check th->interrupt_mask. * thread.c (set_unblock_function, rb_thread_schedule): replace th->interrupt_flag with RUBY_VM_INTERRUPTED_ANY() * signal.c (signal_exec): set up thread->interrupt_mask for preventing recursive trap handler. * vm_core.h (RUBY_VM_CHECK_INTS, RUBY_VM_CHECK_INTS_BLOCKING): ditto. * thread.c (rb_threadptr_execute_interrupts): don't process interrupt if it is masked. [Bug #6009] [ruby-core:42524] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37861 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby_atomic.h: renamed from atomic.h to avoid header file name conflictngoto2012-11-091-0/+115
on Solaris 10. [ruby-dev:46414] [Bug #7287] * gc.c, signal.c, vm_core.h, common.mk: reflect the rename from atomic.h to ruby_atomic.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37604 b2dd03c8-39d4-4d8f-98ff-823fe69b080e