From 5247d3e736f77ce19bbb3e69cf5186fa5a7084f4 Mon Sep 17 00:00:00 2001 From: Lars Kanis Date: Sun, 16 Apr 2023 20:40:17 +0200 Subject: 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. --- ext/ffi_c/FunctionInfo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext/ffi_c/FunctionInfo.c') diff --git a/ext/ffi_c/FunctionInfo.c b/ext/ffi_c/FunctionInfo.c index 7f77621..197c681 100644 --- a/ext/ffi_c/FunctionInfo.c +++ b/ext/ffi_c/FunctionInfo.c @@ -67,7 +67,7 @@ const rb_data_type_t rbffi_fntype_data_type = { /* extern */ .parent = &rbffi_type_data_type, // IMPORTANT: WB_PROTECTED objects must only use the RB_OBJ_WRITE() // macro to update VALUE references, as to trigger write barriers. - .flags = RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_WB_PROTECTED + .flags = RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_WB_PROTECTED | FFI_RUBY_TYPED_FROZEN_SHAREABLE }; VALUE rbffi_FunctionTypeClass = Qnil; -- cgit v1.2.1