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

ruby-changes:31370

From: nobu <ko1@a...>
Date: Mon, 28 Oct 2013 14:57:08 +0900 (JST)
Subject: [ruby-changes:31370] nobu:r43449 (trunk): load.c: share feature names

nobu	2013-10-28 14:57:04 +0900 (Mon, 28 Oct 2013)

  New Revision: 43449

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=43449

  Log:
    load.c: share feature names
    
    * load.c (ruby_init_ext): share feature names between frame name and
      provided features.

  Modified files:
    trunk/ChangeLog
    trunk/load.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 43448)
+++ ChangeLog	(revision 43449)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Mon Oct 28 14:57:01 2013  Nobuyoshi Nakada  <nobu@r...>
+
+	* load.c (ruby_init_ext): share feature names between frame name and
+	  provided features.
+
 Mon Oct 28 14:41:27 2013  Akinori MUSHA  <knu@i...>
 
 	* misc/ruby-electric.el: Import ruby-electric.el 2.1 from
Index: load.c
===================================================================
--- load.c	(revision 43448)
+++ load.c	(revision 43449)
@@ -1013,9 +1013,11 @@ ruby_init_ext(const char *name, void (*i https://github.com/ruby/ruby/blob/trunk/load.c#L1013
 {
     char* const lock_key = load_lock(name);
     if (lock_key) {
+	VALUE feature = rb_usascii_str_new_cstr(name);
+	OBJ_FREEZE(feature);
 	rb_vm_call_cfunc(rb_vm_top_self(), init_ext_call, (VALUE)init,
-			 0, rb_str_new2(name));
-	rb_provide(name);
+			 0, feature);
+	rb_provide_feature(feature);
 	load_unlock(lock_key, 1);
     }
 }

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

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