[前][次][番号順一覧][スレッド一覧]

ruby-changes:50314

From: nobu <ko1@a...>
Date: Fri, 16 Feb 2018 17:39:54 +0900 (JST)
Subject: [ruby-changes:50314] nobu:r62429 (trunk): no ID cache in Init functions

nobu	2018-02-16 17:39:48 +0900 (Fri, 16 Feb 2018)

  New Revision: 62429

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=62429

  Log:
    no ID cache in Init functions
    
    Init functions are called only once, cache is useless.

  Modified files:
    trunk/ext/digest/bubblebabble/bubblebabble.c
    trunk/ext/digest/digest.c
    trunk/ext/fiddle/pointer.c
    trunk/ext/json/generator/generator.c
    trunk/ext/json/parser/parser.c
    trunk/ext/objspace/objspace.c
    trunk/ext/objspace/objspace_dump.c
    trunk/ext/openssl/ossl.c
    trunk/ext/openssl/ossl_asn1.c
    trunk/ext/openssl/ossl_pkcs12.c
    trunk/ext/openssl/ossl_pkcs7.c
    trunk/ext/openssl/ossl_pkey.c
    trunk/ext/openssl/ossl_pkey_ec.c
    trunk/ext/openssl/ossl_x509ext.c
    trunk/ext/openssl/ossl_x509name.c
    trunk/ext/openssl/ossl_x509store.c
    trunk/ext/psych/psych_emitter.c
    trunk/ext/psych/psych_parser.c
    trunk/ext/readline/readline.c
    trunk/ext/stringio/stringio.c
    trunk/ext/strscan/strscan.c
    trunk/ext/syslog/syslog.c
    trunk/ext/win32ole/win32ole_event.c
    trunk/ext/win32ole/win32ole_variant.c
    trunk/ext/zlib/zlib.c
    trunk/proc.c
    trunk/thread_sync.c
Index: ext/stringio/stringio.c
===================================================================
--- ext/stringio/stringio.c	(revision 62428)
+++ ext/stringio/stringio.c	(revision 62429)
@@ -1622,6 +1622,7 @@ strio_set_encoding(int argc, VALUE *argv https://github.com/ruby/ruby/blob/trunk/ext/stringio/stringio.c#L1622
 void
 Init_stringio(void)
 {
+#undef rb_intern
     VALUE StringIO = rb_define_class("StringIO", rb_cData);
 
     rb_include_module(StringIO, rb_mEnumerable);
Index: proc.c
===================================================================
--- proc.c	(revision 62428)
+++ proc.c	(revision 62429)
@@ -3078,6 +3078,7 @@ rb_method_curry(int argc, const VALUE *a https://github.com/ruby/ruby/blob/trunk/proc.c#L3078
 void
 Init_Proc(void)
 {
+#undef rb_intern
     /* Proc */
     rb_cProc = rb_define_class("Proc", rb_cObject);
     rb_undef_alloc_func(rb_cProc);
Index: thread_sync.c
===================================================================
--- thread_sync.c	(revision 62428)
+++ thread_sync.c	(revision 62429)
@@ -1379,6 +1379,7 @@ define_thread_class(VALUE outer, const c https://github.com/ruby/ruby/blob/trunk/thread_sync.c#L1379
 static void
 Init_thread_sync(void)
 {
+#undef rb_intern
 #if 0
     rb_cMutex = rb_define_class("Mutex", rb_cObject); /* teach rdoc Mutex */
     rb_cConditionVariable = rb_define_class("ConditionVariable", rb_cObject); /* teach rdoc ConditionVariable */
Index: ext/digest/digest.c
===================================================================
--- ext/digest/digest.c	(revision 62428)
+++ ext/digest/digest.c	(revision 62429)
@@ -728,6 +728,7 @@ rb_digest_base_block_length(VALUE self) https://github.com/ruby/ruby/blob/trunk/ext/digest/digest.c#L728
 void
 Init_digest(void)
 {
+#undef rb_intern
     id_reset           = rb_intern("reset");
     id_update          = rb_intern("update");
     id_finish          = rb_intern("finish");
Index: ext/digest/bubblebabble/bubblebabble.c
===================================================================
--- ext/digest/bubblebabble/bubblebabble.c	(revision 62428)
+++ ext/digest/bubblebabble/bubblebabble.c	(revision 62429)
@@ -124,6 +124,7 @@ rb_digest_instance_bubblebabble(VALUE se https://github.com/ruby/ruby/blob/trunk/ext/digest/bubblebabble/bubblebabble.c#L124
 void
 Init_bubblebabble(void)
 {
+#undef rb_intern
     VALUE rb_mDigest, rb_mDigest_Instance, rb_cDigest_Class;
 
     rb_require("digest");
Index: ext/syslog/syslog.c
===================================================================
--- ext/syslog/syslog.c	(revision 62428)
+++ ext/syslog/syslog.c	(revision 62429)
@@ -420,6 +420,7 @@ static VALUE mSyslogMacros_included(VALU https://github.com/ruby/ruby/blob/trunk/ext/syslog/syslog.c#L420
  */
 void Init_syslog(void)
 {
+#undef rb_intern
     mSyslog = rb_define_module("Syslog");
 
     mSyslogConstants    = rb_define_module_under(mSyslog, "Constants");
Index: ext/objspace/objspace.c
===================================================================
--- ext/objspace/objspace.c	(revision 62428)
+++ ext/objspace/objspace.c	(revision 62429)
@@ -936,6 +936,7 @@ void Init_objspace_dump(VALUE rb_mObjSpa https://github.com/ruby/ruby/blob/trunk/ext/objspace/objspace.c#L936
 void
 Init_objspace(void)
 {
+#undef rb_intern
     VALUE rb_mObjSpace;
 #if 0
     rb_mObjSpace = rb_define_module("ObjectSpace"); /* let rdoc know */
Index: ext/objspace/objspace_dump.c
===================================================================
--- ext/objspace/objspace_dump.c	(revision 62428)
+++ ext/objspace/objspace_dump.c	(revision 62429)
@@ -498,6 +498,7 @@ objspace_dump_all(int argc, VALUE *argv, https://github.com/ruby/ruby/blob/trunk/ext/objspace/objspace_dump.c#L498
 void
 Init_objspace_dump(VALUE rb_mObjSpace)
 {
+#undef rb_intern
 #if 0
     rb_mObjSpace = rb_define_module("ObjectSpace"); /* let rdoc know */
 #endif
Index: ext/zlib/zlib.c
===================================================================
--- ext/zlib/zlib.c	(revision 62428)
+++ ext/zlib/zlib.c	(revision 62429)
@@ -4477,6 +4477,7 @@ zlib_gunzip_run(VALUE arg) https://github.com/ruby/ruby/blob/trunk/ext/zlib/zlib.c#L4477
 void
 Init_zlib(void)
 {
+#undef rb_intern
     VALUE mZlib, cZStream, cDeflate, cInflate;
 #if GZIP_SUPPORT
     VALUE cGzipFile, cGzipWriter, cGzipReader;
Index: ext/win32ole/win32ole_variant.c
===================================================================
--- ext/win32ole/win32ole_variant.c	(revision 62428)
+++ ext/win32ole/win32ole_variant.c	(revision 62429)
@@ -692,6 +692,7 @@ ole_variant2variant(VALUE val, VARIANT * https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole_variant.c#L692
 void
 Init_win32ole_variant(void)
 {
+#undef rb_intern
     cWIN32OLE_VARIANT = rb_define_class("WIN32OLE_VARIANT", rb_cObject);
     rb_define_alloc_func(cWIN32OLE_VARIANT, folevariant_s_allocate);
     rb_define_singleton_method(cWIN32OLE_VARIANT, "array", folevariant_s_array, 2);
Index: ext/win32ole/win32ole_event.c
===================================================================
--- ext/win32ole/win32ole_event.c	(revision 62428)
+++ ext/win32ole/win32ole_event.c	(revision 62429)
@@ -1264,6 +1264,7 @@ fev_get_handler(VALUE self) https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole_event.c#L1264
 void
 Init_win32ole_event(void)
 {
+#undef rb_intern
     ary_ole_event = rb_ary_new();
     rb_gc_register_mark_object(ary_ole_event);
     id_events = rb_intern("events");
Index: ext/json/generator/generator.c
===================================================================
--- ext/json/generator/generator.c	(revision 62428)
+++ ext/json/generator/generator.c	(revision 62429)
@@ -1335,6 +1335,7 @@ static VALUE cState_buffer_initial_lengt https://github.com/ruby/ruby/blob/trunk/ext/json/generator/generator.c#L1335
  */
 void Init_generator(void)
 {
+#undef rb_intern
     rb_require("json/common");
 
     mJSON = rb_define_module("JSON");
Index: ext/json/parser/parser.c
===================================================================
--- ext/json/parser/parser.c	(revision 62428)
+++ ext/json/parser/parser.c	(revision 62429)
@@ -2064,6 +2064,7 @@ static VALUE cParser_source(VALUE self) https://github.com/ruby/ruby/blob/trunk/ext/json/parser/parser.c#L2064
 
 void Init_parser(void)
 {
+#undef rb_intern
     rb_require("json/common");
     mJSON = rb_define_module("JSON");
     mExt = rb_define_module_under(mJSON, "Ext");
Index: ext/readline/readline.c
===================================================================
--- ext/readline/readline.c	(revision 62428)
+++ ext/readline/readline.c	(revision 62429)
@@ -1996,8 +1996,8 @@ Init_readline(void) https://github.com/ruby/ruby/blob/trunk/ext/readline/readline.c#L1996
                                readline_s_get_special_prefixes, 0);
 
 #if USE_INSERT_IGNORE_ESCAPE
-    CONST_ID(id_orig_prompt, "orig_prompt");
-    CONST_ID(id_last_prompt, "last_prompt");
+    id_orig_prompt = rb_intern("orig_prompt");
+    id_last_prompt = rb_intern("last_prompt");
 #endif
 
     history = rb_obj_alloc(rb_cObject);
Index: ext/openssl/ossl_pkey_ec.c
===================================================================
--- ext/openssl/ossl_pkey_ec.c	(revision 62428)
+++ ext/openssl/ossl_pkey_ec.c	(revision 62429)
@@ -1649,6 +1649,7 @@ static VALUE ossl_ec_point_mul(int argc, https://github.com/ruby/ruby/blob/trunk/ext/openssl/ossl_pkey_ec.c#L1649
 
 void Init_ossl_ec(void)
 {
+#undef rb_intern
 #if 0
     mPKey = rb_define_module_under(mOSSL, "PKey");
     cPKey = rb_define_class_under(mPKey, "PKey", rb_cObject);
Index: ext/openssl/ossl.c
===================================================================
--- ext/openssl/ossl.c	(revision 62428)
+++ ext/openssl/ossl.c	(revision 62429)
@@ -1099,6 +1099,7 @@ static void Init_ossl_locks(void) https://github.com/ruby/ruby/blob/trunk/ext/openssl/ossl.c#L1099
 void
 Init_openssl(void)
 {
+#undef rb_intern
     /*
      * Init timezone info
      */
Index: ext/openssl/ossl_x509store.c
===================================================================
--- ext/openssl/ossl_x509store.c	(revision 62428)
+++ ext/openssl/ossl_x509store.c	(revision 62429)
@@ -771,6 +771,7 @@ ossl_x509stctx_set_time(VALUE self, VALU https://github.com/ruby/ruby/blob/trunk/ext/openssl/ossl_x509store.c#L771
 void
 Init_ossl_x509store(void)
 {
+#undef rb_intern
 #if 0
     mOSSL = rb_define_module("OpenSSL");
     eOSSLError = rb_define_class_under(mOSSL, "OpenSSLError", rb_eStandardError);
Index: ext/openssl/ossl_asn1.c
===================================================================
--- ext/openssl/ossl_asn1.c	(revision 62428)
+++ ext/openssl/ossl_asn1.c	(revision 62429)
@@ -1360,6 +1360,7 @@ OSSL_ASN1_IMPL_FACTORY_METHOD(EndOfConte https://github.com/ruby/ruby/blob/trunk/ext/openssl/ossl_asn1.c#L1360
 void
 Init_ossl_asn1(void)
 {
+#undef rb_intern
     VALUE ary;
     int i;
 
Index: ext/openssl/ossl_pkcs12.c
===================================================================
--- ext/openssl/ossl_pkcs12.c	(revision 62428)
+++ ext/openssl/ossl_pkcs12.c	(revision 62429)
@@ -232,6 +232,7 @@ ossl_pkcs12_to_der(VALUE self) https://github.com/ruby/ruby/blob/trunk/ext/openssl/ossl_pkcs12.c#L232
 void
 Init_ossl_pkcs12(void)
 {
+#undef rb_intern
 #if 0
     mOSSL = rb_define_module("OpenSSL");
     eOSSLError = rb_define_class_under(mOSSL, "OpenSSLError", rb_eStandardError);
Index: ext/openssl/ossl_x509name.c
===================================================================
--- ext/openssl/ossl_x509name.c	(revision 62428)
+++ ext/openssl/ossl_x509name.c	(revision 62429)
@@ -502,6 +502,7 @@ ossl_x509name_to_der(VALUE self) https://github.com/ruby/ruby/blob/trunk/ext/openssl/ossl_x509name.c#L502
 void
 Init_ossl_x509name(void)
 {
+#undef rb_intern
     VALUE utf8str, ptrstr, ia5str, hash;
 
 #if 0
Index: ext/openssl/ossl_pkey.c
===================================================================
--- ext/openssl/ossl_pkey.c	(revision 62428)
+++ ext/openssl/ossl_pkey.c	(revision 62429)
@@ -389,6 +389,7 @@ ossl_pkey_verify(VALUE self, VALUE diges https://github.com/ruby/ruby/blob/trunk/ext/openssl/ossl_pkey.c#L389
 void
 Init_ossl_pkey(void)
 {
+#undef rb_intern
 #if 0
     mOSSL = rb_define_module("OpenSSL");
     eOSSLError = rb_define_class_under(mOSSL, "OpenSSLError", rb_eStandardError);
Index: ext/openssl/ossl_x509ext.c
===================================================================
--- ext/openssl/ossl_x509ext.c	(revision 62428)
+++ ext/openssl/ossl_x509ext.c	(revision 62429)
@@ -437,6 +437,7 @@ ossl_x509ext_to_der(VALUE obj) https://github.com/ruby/ruby/blob/trunk/ext/openssl/ossl_x509ext.c#L437
 void
 Init_ossl_x509ext(void)
 {
+#undef rb_intern
 #if 0
     mOSSL = rb_define_module("OpenSSL");
     eOSSLError = rb_define_class_under(mOSSL, "OpenSSLError", rb_eStandardError);
Index: ext/openssl/ossl_pkcs7.c
===================================================================
--- ext/openssl/ossl_pkcs7.c	(revision 62428)
+++ ext/openssl/ossl_pkcs7.c	(revision 62429)
@@ -1042,6 +1042,7 @@ ossl_pkcs7ri_get_enc_key(VALUE self) https://github.com/ruby/ruby/blob/trunk/ext/openssl/ossl_pkcs7.c#L1042
 void
 Init_ossl_pkcs7(void)
 {
+#undef rb_intern
 #if 0
     mOSSL = rb_define_module("OpenSSL");
     eOSSLError = rb_define_class_under(mOSSL, "OpenSSLError", rb_eStandardError);
Index: ext/psych/psych_emitter.c
===================================================================
--- ext/psych/psych_emitter.c	(revision 62428)
+++ ext/psych/psych_emitter.c	(revision 62429)
@@ -521,6 +521,7 @@ static VALUE set_line_width(VALUE self, https://github.com/ruby/ruby/blob/trunk/ext/psych/psych_emitter.c#L521
 
 void Init_psych_emitter(void)
 {
+#undef rb_intern
     VALUE psych     = rb_define_module("Psych");
     VALUE handler   = rb_define_class_under(psych, "Handler", rb_cObject);
     cPsychEmitter   = rb_define_class_under(psych, "Emitter", handler);
Index: ext/psych/psych_parser.c
===================================================================
--- ext/psych/psych_parser.c	(revision 62428)
+++ ext/psych/psych_parser.c	(revision 62429)
@@ -548,6 +548,7 @@ static VALUE mark(VALUE self) https://github.com/ruby/ruby/blob/trunk/ext/psych/psych_parser.c#L548
 
 void Init_psych_parser(void)
 {
+#undef rb_intern
 #if 0
     mPsych = rb_define_module("Psych");
 #endif
Index: ext/fiddle/pointer.c
===================================================================
--- ext/fiddle/pointer.c	(revision 62428)
+++ ext/fiddle/pointer.c	(revision 62429)
@@ -677,6 +677,7 @@ rb_fiddle_ptr_s_to_ptr(VALUE self, VALUE https://github.com/ruby/ruby/blob/trunk/ext/fiddle/pointer.c#L677
 void
 Init_fiddle_pointer(void)
 {
+#undef rb_intern
     id_to_ptr = rb_intern("to_ptr");
 
     /* Document-class: Fiddle::Pointer
Index: ext/strscan/strscan.c
===================================================================
--- ext/strscan/strscan.c	(revision 62428)
+++ ext/strscan/strscan.c	(revision 62429)
@@ -1412,6 +1412,7 @@ inspect2(struct strscanner *p) https://github.com/ruby/ruby/blob/trunk/ext/strscan/strscan.c#L1412
 void
 Init_strscan(void)
 {
+#undef rb_intern
     ID id_scanerr = rb_intern("ScanError");
     VALUE tmp;
 

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]