Skip to content

Commit 2c7c6de

Browse files
committed
Implement Write Barrier for all OpenSSL types
The vast majority have no reference so it's just a matter of setting the flags. For the couple exception, they have very little references so it's easy.
1 parent bd7b593 commit 2c7c6de

23 files changed

+51
-38
lines changed

ext/openssl/ossl_bn.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ static const rb_data_type_t ossl_bn_type = {
4141
{
4242
0, ossl_bn_free,
4343
},
44-
0, 0, RUBY_TYPED_FREE_IMMEDIATELY,
44+
0, 0, RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_WB_PROTECTED,
4545
};
4646

4747
/*

ext/openssl/ossl_cipher.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ static const rb_data_type_t ossl_cipher_type = {
4242
{
4343
0, ossl_cipher_free,
4444
},
45-
0, 0, RUBY_TYPED_FREE_IMMEDIATELY,
45+
0, 0, RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_WB_PROTECTED,
4646
};
4747

4848
/*

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,
25+
0, 0, RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_WB_PROTECTED,
2626
};
2727

2828
CONF *

ext/openssl/ossl_digest.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ static const rb_data_type_t ossl_digest_type = {
3535
{
3636
0, ossl_digest_free,
3737
},
38-
0, 0, RUBY_TYPED_FREE_IMMEDIATELY,
38+
0, 0, RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_WB_PROTECTED,
3939
};
4040

4141
/*

ext/openssl/ossl_engine.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ static const rb_data_type_t ossl_engine_type = {
7878
{
7979
0, ossl_engine_free,
8080
},
81-
0, 0, RUBY_TYPED_FREE_IMMEDIATELY,
81+
0, 0, RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_WB_PROTECTED,
8282
};
8383

8484
/*

ext/openssl/ossl_hmac.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ static const rb_data_type_t ossl_hmac_type = {
4242
{
4343
0, ossl_hmac_free,
4444
},
45-
0, 0, RUBY_TYPED_FREE_IMMEDIATELY,
45+
0, 0, RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_WB_PROTECTED,
4646
};
4747

4848
static VALUE

ext/openssl/ossl_ns_spki.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ static const rb_data_type_t ossl_netscape_spki_type = {
5050
{
5151
0, ossl_netscape_spki_free,
5252
},
53-
0, 0, RUBY_TYPED_FREE_IMMEDIATELY,
53+
0, 0, RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_WB_PROTECTED,
5454
};
5555

5656
static VALUE

ext/openssl/ossl_ocsp.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ static const rb_data_type_t ossl_ocsp_request_type = {
8686
{
8787
0, ossl_ocsp_request_free,
8888
},
89-
0, 0, RUBY_TYPED_FREE_IMMEDIATELY,
89+
0, 0, RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_WB_PROTECTED,
9090
};
9191

9292
static void
@@ -100,7 +100,7 @@ static const rb_data_type_t ossl_ocsp_response_type = {
100100
{
101101
0, ossl_ocsp_response_free,
102102
},
103-
0, 0, RUBY_TYPED_FREE_IMMEDIATELY,
103+
0, 0, RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_WB_PROTECTED,
104104
};
105105

106106
static void
@@ -114,7 +114,7 @@ static const rb_data_type_t ossl_ocsp_basicresp_type = {
114114
{
115115
0, ossl_ocsp_basicresp_free,
116116
},
117-
0, 0, RUBY_TYPED_FREE_IMMEDIATELY,
117+
0, 0, RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_WB_PROTECTED,
118118
};
119119

120120
static void
@@ -128,7 +128,7 @@ static const rb_data_type_t ossl_ocsp_singleresp_type = {
128128
{
129129
0, ossl_ocsp_singleresp_free,
130130
},
131-
0, 0, RUBY_TYPED_FREE_IMMEDIATELY,
131+
0, 0, RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_WB_PROTECTED,
132132
};
133133

134134
static void
@@ -142,7 +142,7 @@ static const rb_data_type_t ossl_ocsp_certid_type = {
142142
{
143143
0, ossl_ocsp_certid_free,
144144
},
145-
0, 0, RUBY_TYPED_FREE_IMMEDIATELY,
145+
0, 0, RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_WB_PROTECTED,
146146
};
147147

148148
/*

ext/openssl/ossl_pkcs12.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ static const rb_data_type_t ossl_pkcs12_type = {
4444
{
4545
0, ossl_pkcs12_free,
4646
},
47-
0, 0, RUBY_TYPED_FREE_IMMEDIATELY,
47+
0, 0, RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_WB_PROTECTED,
4848
};
4949

5050
static VALUE

ext/openssl/ossl_pkcs7.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ const rb_data_type_t ossl_pkcs7_type = {
6565
{
6666
0, ossl_pkcs7_free,
6767
},
68-
0, 0, RUBY_TYPED_FREE_IMMEDIATELY,
68+
0, 0, RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_WB_PROTECTED,
6969
};
7070

7171
static void
@@ -79,7 +79,7 @@ static const rb_data_type_t ossl_pkcs7_signer_info_type = {
7979
{
8080
0, ossl_pkcs7_signer_info_free,
8181
},
82-
0, 0, RUBY_TYPED_FREE_IMMEDIATELY,
82+
0, 0, RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_WB_PROTECTED,
8383
};
8484

8585
static void
@@ -93,7 +93,7 @@ static const rb_data_type_t ossl_pkcs7_recip_info_type = {
9393
{
9494
0, ossl_pkcs7_recip_info_free,
9595
},
96-
0, 0, RUBY_TYPED_FREE_IMMEDIATELY,
96+
0, 0, RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_WB_PROTECTED,
9797
};
9898

9999
/*

0 commit comments

Comments
 (0)