atomic 1.1.13 → 1.1.14

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 20f8398764e9107775042e0a15438b9ef25ec768
4
- data.tar.gz: 9a24887a14a0dd7b6e34315d3bd562f18085cf68
3
+ metadata.gz: aad6e8fcd730576258b61e5d55b5025b2b48e4b8
4
+ data.tar.gz: 866cfa7563c4712d30582c20234fefb6bfa2e26e
5
5
  SHA512:
6
- metadata.gz: b8bb15fb836f6c3fa7706cd46bf3314b277f8fdcf8a4e549398ef03bf946ca3b3df9bdb5d2ef9775735ad8d65276d09f7a5a7063290eb1280d11174dc390a88e
7
- data.tar.gz: ef93a47266cde2b9e965c4c3f3d14e0c9dfae6d9b59e3954037d639dfe89f228b3401841892aa7081a7e6e743516438b850a739ddfc9df3c5c7d012d790b0b16
6
+ metadata.gz: bff4c0711a3196ec7cdd8a8a09cf2de07986ccbcf6a8048197f464762972a015a0a6635c9b47f2f6636242b4145c87ca131706c3d24591aacae2ea73c169ff2b
7
+ data.tar.gz: d3d1a084b48fde881006f43b8f954ee4593bc919c9c77e912102c7b84bdcfac1da5839fbd46b096b14d418f7264505b202f2f4d2ec5c65f002e605cd31b61b48
@@ -4,7 +4,7 @@
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.name = %q{atomic}
7
- s.version = "1.1.13"
7
+ s.version = "1.1.14"
8
8
  s.authors = ["Charles Oliver Nutter", "MenTaLguY", "Sokolov Yura"]
9
9
  s.date = Time.now.strftime('%Y-%m-%d')
10
10
  s.summary = "An atomic reference implementation for JRuby, Rubinius, and MRI"
@@ -11,6 +11,9 @@
11
11
  // limitations under the License.
12
12
 
13
13
  #include <ruby.h>
14
+ #if defined(__sun)
15
+ #include <atomic.h>
16
+ #endif
14
17
 
15
18
  static void ir_mark(void *value) {
16
19
  rb_gc_mark_maybe((VALUE) value);
@@ -50,6 +53,20 @@ static VALUE ir_compare_and_set(volatile VALUE self, VALUE expect_value, VALUE n
50
53
  if (OSAtomicCompareAndSwap64(expect_value, new_value, &DATA_PTR(self))) {
51
54
  return Qtrue;
52
55
  }
56
+ #elif defined(__sun)
57
+ /* Assuming VALUE is uintptr_t */
58
+ /* Based on the definition of uintptr_t from /usr/include/sys/int_types.h */
59
+ #if defined(_LP64) || defined(_I32LPx)
60
+ /* 64-bit: uintptr_t === unsigned long */
61
+ if (atomic_cas_ulong((uintptr_t *) &DATA_PTR(self), expect_value, new_value)) {
62
+ return Qtrue;
63
+ }
64
+ #else
65
+ /* 32-bit: uintptr_t === unsigned int */
66
+ if (atomic_cas_uint((uintptr_t *) &DATA_PTR(self), expect_value, new_value)) {
67
+ return Qtrue;
68
+ }
69
+ #endif
53
70
  #elif HAVE_GCC_CAS
54
71
  if (__sync_bool_compare_and_swap(&DATA_PTR(self), expect_value, new_value)) {
55
72
  return Qtrue;
@@ -14,11 +14,13 @@ require 'mkmf'
14
14
  extension_name = 'atomic_reference'
15
15
  dir_config(extension_name)
16
16
 
17
- case CONFIG["arch"]
18
- when /mswin32|mingw|solaris/
19
- $CFLAGS += " -march=native"
20
- when 'i686-linux'
21
- $CFLAGS += " -march=i686"
17
+ if CONFIG["GCC"] && CONFIG["GCC"] != ""
18
+ case CONFIG["arch"]
19
+ when /mswin32|mingw|solaris/
20
+ $CFLAGS += " -march=native"
21
+ when 'i686-linux'
22
+ $CFLAGS += " -march=i686"
23
+ end
22
24
  end
23
25
 
24
26
  try_run(<<CODE,$CFLAGS) && ($defs << '-DHAVE_GCC_CAS')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: atomic
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.13
4
+ version: 1.1.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Charles Oliver Nutter
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-08-14 00:00:00.000000000 Z
13
+ date: 2013-09-10 00:00:00.000000000 Z
14
14
  dependencies: []
15
15
  description: An atomic reference implementation for JRuby, Rubinius, and MRI
16
16
  email: