Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use TruffleRuby::ConcurrentMap backend for Concurrent::Map if available
- Loading branch information
1 parent
7b7900a
commit c1c7a7f
Showing
2 changed files
with
21 additions
and
3 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
lib/concurrent-ruby/concurrent/collection/map/truffleruby_map_backend.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module Concurrent | ||
|
||
# @!visibility private | ||
module Collection | ||
|
||
# @!visibility private | ||
class TruffleRubyMapBackend < TruffleRuby::ConcurrentMap | ||
def initialize(options = nil) | ||
options ||= {} | ||
super(initial_capacity: options[:initial_capacity], load_factor: options[:load_factor]) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters