From 7ab64d74805272f046a97ebfc8273ac6a32f674f Mon Sep 17 00:00:00 2001 From: HoneyryderChuck Date: Sat, 19 Oct 2024 16:39:19 +0100 Subject: [PATCH] store and store context: shareable when frozen --- ext/openssl/ossl.h | 5 +++++ ext/openssl/ossl_x509store.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ext/openssl/ossl.h b/ext/openssl/ossl.h index c3140ac3e..24d251f6a 100644 --- a/ext/openssl/ossl.h +++ b/ext/openssl/ossl.h @@ -17,6 +17,11 @@ #include #include #include +#ifdef HAVE_RB_EXT_RACTOR_SAFE +#include +#else +#define RUBY_TYPED_FROZEN_SHAREABLE 0 +#endif #include #include diff --git a/ext/openssl/ossl_x509store.c b/ext/openssl/ossl_x509store.c index 9548e5d68..bc19cc53c 100644 --- a/ext/openssl/ossl_x509store.c +++ b/ext/openssl/ossl_x509store.c @@ -133,7 +133,7 @@ static const rb_data_type_t ossl_x509store_type = { { ossl_x509store_mark, ossl_x509store_free, }, - 0, 0, RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_WB_PROTECTED, + 0, 0, RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_WB_PROTECTED | RUBY_TYPED_FROZEN_SHAREABLE, }; /*