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

ruby-changes:41570

From: normal <ko1@a...>
Date: Sun, 24 Jan 2016 19:35:30 +0900 (JST)
Subject: [ruby-changes:41570] normal:r53644 (trunk): vm_insnhelper.c (vm_check_if_namespace): tiny size reduction

normal	2016-01-24 19:36:16 +0900 (Sun, 24 Jan 2016)

  New Revision: 53644

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

  Log:
    vm_insnhelper.c (vm_check_if_namespace): tiny size reduction
    
    Take advantage of "%+" modifier in the format string instead of
    explicitly calling rb_inspect to reduce object size.
    
    On x86 32-bit:
    
               text    data     bss     dec     hex filename
    before: 2949572   12448   30680 2992700  2daa3c miniruby
    after:  2949464   12448   30680 2992592  2da9d0 miniruby

  Modified files:
    trunk/ChangeLog
    trunk/vm_insnhelper.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 53643)
+++ ChangeLog	(revision 53644)
@@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sun Jan 24 19:34:23 2016  Eric Wong  <e@8...>
+
+	* vm_insnhelper.c (vm_check_if_namespace): tiny size reduction
+
 Sun Jan 24 18:12:36 2016  Martin Duerst  <duerst@i...>
 
 	* common.mk: Simplifying Unicode data file download logic to make
Index: vm_insnhelper.c
===================================================================
--- vm_insnhelper.c	(revision 53643)
+++ vm_insnhelper.c	(revision 53644)
@@ -643,11 +643,8 @@ vm_get_const_base(const VALUE *ep) https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L643
 static inline void
 vm_check_if_namespace(VALUE klass)
 {
-    VALUE str;
     if (!RB_TYPE_P(klass, T_CLASS) && !RB_TYPE_P(klass, T_MODULE)) {
-	str = rb_inspect(klass);
-	rb_raise(rb_eTypeError, "%s is not a class/module",
-		 StringValuePtr(str));
+	rb_raise(rb_eTypeError, "%+"PRIsVALUE" is not a class/module", klass);
     }
 }
 

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

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