diff options
Diffstat (limited to 'lib/ffi/types.rb')
-rw-r--r-- | lib/ffi/types.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/ffi/types.rb b/lib/ffi/types.rb index da214ee..8f5d897 100644 --- a/lib/ffi/types.rb +++ b/lib/ffi/types.rb @@ -33,6 +33,15 @@ # see {file:README} module FFI + unless defined?(self.custom_typedefs) + # Truffleruby and JRuby don't support Ractor so far. + # So they don't need separation between builtin and custom types. + def self.custom_typedefs + TypeDefs + end + writable_typemap = true + end + # @param [Type, DataConverter, Symbol] old type definition used by {FFI.find_type} # @param [Symbol] add new type definition's name to add # @return [Type] @@ -206,5 +215,5 @@ module FFI rescue Errno::ENOENT end - FFI.make_shareable(TypeDefs) + FFI.make_shareable(TypeDefs) unless writable_typemap end |