Skip to content

Commit bc680a9

Browse files
make configs shareable when frozen
1 parent c09506e commit bc680a9

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

ext/openssl/ossl_config.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ static const rb_data_type_t ossl_config_type = {
2222
{
2323
0, nconf_free,
2424
},
25-
0, 0, RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_WB_PROTECTED,
25+
0, 0, RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_WB_PROTECTED | RUBY_TYPED_FROZEN_SHAREABLE,
2626
};
2727

2828
CONF *

test/openssl/test_config.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,15 @@ def test_dup
275275
assert_equal(@it.sections.sort, c2.sections.sort)
276276
end
277277

278+
if respond_to?(:ractor)
279+
ractor
280+
def test_ractor
281+
assert Ractor.shareable?(@it)
282+
assert Ractor.shareable?(OpenSSL::Config.parse("[empty]\n"))
283+
assert Ractor.shareable?(OpenSSL::Config::DEFAULT_CONFIG_FILE)
284+
end
285+
end
286+
278287
private
279288

280289
def in_tmpdir(*args)

0 commit comments

Comments
 (0)