ruby-changes:58199
From: Nobuyoshi <ko1@a...>
Date: Thu, 10 Oct 2019 20:00:27 +0900 (JST)
Subject: [ruby-changes:58199] 9c0cd5c569 (master): Prefer rb_gc_register_mark_object
https://git.ruby-lang.org/ruby.git/commit/?id=9c0cd5c569 From 9c0cd5c569ba22bc68d1a77ad6580a275cd99639 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Thu, 10 Oct 2019 19:38:37 +0900 Subject: Prefer rb_gc_register_mark_object * ext/openssl/ossl_asn1.c (Init_ossl_asn1): prefer `rb_gc_register_mark_object`, which is better for constant objects, over `rb_gc_register_address` for global/static variables which can be re-assigned at runtime. [Bug #16196] diff --git a/ext/openssl/ossl_asn1.c b/ext/openssl/ossl_asn1.c index e00c664..0085d4b 100644 --- a/ext/openssl/ossl_asn1.c +++ b/ext/openssl/ossl_asn1.c @@ -1823,8 +1823,8 @@ do{\ https://github.com/ruby/ruby/blob/trunk/ext/openssl/ossl_asn1.c#L1823 rb_define_method(cASN1EndOfContent, "initialize", ossl_asn1eoc_initialize, 0); rb_define_method(cASN1EndOfContent, "to_der", ossl_asn1eoc_to_der, 0); - rb_global_variable(&class_tag_map); class_tag_map = rb_hash_new(); + rb_gc_register_mark_object(class_tag_map); rb_hash_aset(class_tag_map, cASN1EndOfContent, INT2NUM(V_ASN1_EOC)); rb_hash_aset(class_tag_map, cASN1Boolean, INT2NUM(V_ASN1_BOOLEAN)); rb_hash_aset(class_tag_map, cASN1Integer, INT2NUM(V_ASN1_INTEGER)); -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/