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 +4 -4
- data/atomic.gemspec +1 -1
- data/ext/atomic_reference.c +17 -0
- data/ext/extconf.rb +7 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aad6e8fcd730576258b61e5d55b5025b2b48e4b8
|
4
|
+
data.tar.gz: 866cfa7563c4712d30582c20234fefb6bfa2e26e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bff4c0711a3196ec7cdd8a8a09cf2de07986ccbcf6a8048197f464762972a015a0a6635c9b47f2f6636242b4145c87ca131706c3d24591aacae2ea73c169ff2b
|
7
|
+
data.tar.gz: d3d1a084b48fde881006f43b8f954ee4593bc919c9c77e912102c7b84bdcfac1da5839fbd46b096b14d418f7264505b202f2f4d2ec5c65f002e605cd31b61b48
|
data/atomic.gemspec
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |s|
|
6
6
|
s.name = %q{atomic}
|
7
|
-
s.version = "1.1.
|
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"
|
data/ext/atomic_reference.c
CHANGED
@@ -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;
|
data/ext/extconf.rb
CHANGED
@@ -14,11 +14,13 @@ require 'mkmf'
|
|
14
14
|
extension_name = 'atomic_reference'
|
15
15
|
dir_config(extension_name)
|
16
16
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
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.
|
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-
|
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:
|