File tree Expand file tree Collapse file tree 2 files changed +21
-2
lines changed
lib/concurrent-ruby/concurrent Expand file tree Collapse file tree 2 files changed +21
-2
lines changed Original file line number Diff line number Diff line change 1+ module Concurrent
2+
3+ # @!visibility private
4+ module Collection
5+
6+ # @!visibility private
7+ class TruffleRubyMapBackend < TruffleRuby ::ConcurrentMap
8+ def initialize ( options = nil )
9+ options ||= { }
10+ super ( initial_capacity : options [ :initial_capacity ] , load_factor : options [ :load_factor ] )
11+ end
12+ end
13+ end
14+ end
Original file line number Diff line number Diff line change @@ -16,8 +16,13 @@ module Collection
1616 require 'concurrent/collection/map/mri_map_backend'
1717 MriMapBackend
1818 when Concurrent . on_rbx? || Concurrent . on_truffleruby?
19- require 'concurrent/collection/map/atomic_reference_map_backend'
20- AtomicReferenceMapBackend
19+ if defined? ( ::TruffleRuby ::ConcurrentMap )
20+ require 'concurrent/collection/map/truffleruby_map_backend'
21+ TruffleRubyMapBackend
22+ else
23+ require 'concurrent/collection/map/atomic_reference_map_backend'
24+ AtomicReferenceMapBackend
25+ end
2126 else
2227 warn 'Concurrent::Map: unsupported Ruby engine, using a fully synchronized Concurrent::Map implementation'
2328 require 'concurrent/collection/map/synchronized_map_backend'
You can’t perform that action at this time.
0 commit comments