Skip to content

Commit 8f3ca0c

Browse files
store and store context: shareable when frozen
1 parent 105d022 commit 8f3ca0c

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

ext/openssl/ossl.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@
1717
#include <errno.h>
1818
#include <ruby/io.h>
1919
#include <ruby/thread.h>
20+
#ifdef HAVE_RB_EXT_RACTOR_SAFE
21+
#include <ruby/ractor.h>
22+
#else
23+
#define RUBY_TYPED_FROZEN_SHAREABLE 0
24+
#endif
2025
#include <openssl/opensslv.h>
2126

2227
#include <openssl/err.h>

ext/openssl/ossl_x509store.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ static const rb_data_type_t ossl_x509store_type = {
133133
{
134134
ossl_x509store_mark, ossl_x509store_free,
135135
},
136-
0, 0, RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_WB_PROTECTED,
136+
0, 0, RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_WB_PROTECTED | RUBY_TYPED_FROZEN_SHAREABLE,
137137
};
138138

139139
/*
@@ -551,7 +551,7 @@ static const rb_data_type_t ossl_x509stctx_type = {
551551
{
552552
ossl_x509stctx_mark, ossl_x509stctx_free,
553553
},
554-
0, 0, RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_WB_PROTECTED,
554+
0, 0, RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_WB_PROTECTED | RUBY_TYPED_FROZEN_SHAREABLE,
555555
};
556556

557557
static VALUE

0 commit comments

Comments
 (0)