atomic 1.1.13-java → 1.1.14-java

Sign up to get free protection for your applications and to get access to all the features.
@@ -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,8 @@
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
+ prerelease:
5
6
  platform: java
6
7
  authors:
7
8
  - Charles Oliver Nutter
@@ -10,7 +11,7 @@ authors:
10
11
  autorequire:
11
12
  bindir: bin
12
13
  cert_chain: []
13
- date: 2013-08-14 00:00:00.000000000 Z
14
+ date: 2013-09-10 00:00:00.000000000 Z
14
15
  dependencies: []
15
16
  description: An atomic reference implementation for JRuby, Rubinius, and MRI
16
17
  email:
@@ -49,7 +50,6 @@ files:
49
50
  homepage: http://github.com/headius/ruby-atomic
50
51
  licenses:
51
52
  - Apache-2.0
52
- metadata: {}
53
53
  post_install_message:
54
54
  rdoc_options: []
55
55
  require_paths:
@@ -59,16 +59,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
59
59
  - - '>='
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
+ none: false
62
63
  required_rubygems_version: !ruby/object:Gem::Requirement
63
64
  requirements:
64
65
  - - '>='
65
66
  - !ruby/object:Gem::Version
66
67
  version: '0'
68
+ none: false
67
69
  requirements: []
68
70
  rubyforge_project:
69
- rubygems_version: 2.0.3
71
+ rubygems_version: 1.8.24
70
72
  signing_key:
71
- specification_version: 4
73
+ specification_version: 3
72
74
  summary: An atomic reference implementation for JRuby, Rubinius, and MRI
73
75
  test_files:
74
76
  - test/test_atomic.rb
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: 4f2c0634bf6442595a541522417e15121d44cefa
4
- data.tar.gz: cb6473373861208ca4aede4c7ec9bd9884caca5f
5
- SHA512:
6
- metadata.gz: 2824ac3b2d05fa07238e4e3c074e6d61827d2a89db6671b55d8cd03ae5e17b2cdbbe99a4ed8e3c16c465eb1d824dee8085de5af2ecd046cd78628981d6e0e396
7
- data.tar.gz: 75e953b579c36bebb85907aa0229abff9ee8067cce73a1c8db57a769212166e851b1605d43e9831b97f680f18958743ae552d3b9359d2c8209598c4f39c66a05