diff options
author | Lars Kanis <lars@greiz-reinsdorf.de> | 2023-04-16 20:40:17 +0200 |
---|---|---|
committer | Lars Kanis <lars@greiz-reinsdorf.de> | 2023-04-18 11:27:14 +0200 |
commit | 5247d3e736f77ce19bbb3e69cf5186fa5a7084f4 (patch) | |
tree | 9675fed8212b9ca4ffbe0929112be10bdd1c5919 /lib/ffi/struct.rb | |
parent | 250c31a25d81339cfe928a433ada3c0f17eae580 (diff) | |
download | ffi-5247d3e736f77ce19bbb3e69cf5186fa5a7084f4.tar.gz |
Add support for using FFI in Ractor
All objects are shareable now when frozen.
All objects can be created in a non-main Ractor.
Typedefs are a global mutable state and are not accessable from Ractor other than the main Ractor.
So all Function, Struct, etc. must be defined in the main Ractor and can then be used in other Ractors.
Diffstat (limited to 'lib/ffi/struct.rb')
-rw-r--r-- | lib/ffi/struct.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/ffi/struct.rb b/lib/ffi/struct.rb index 725b9cb..1283d63 100644 --- a/lib/ffi/struct.rb +++ b/lib/ffi/struct.rb @@ -219,7 +219,7 @@ module FFI end builder.size = @size if defined?(@size) && @size > builder.size cspec = builder.build - @layout = cspec unless self == Struct + @layout = FFI.make_shareable(cspec) unless self == Struct @size = cspec.size return cspec end |