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

ruby-changes:49883

From: nobu <ko1@a...>
Date: Sun, 21 Jan 2018 18:59:50 +0900 (JST)
Subject: [ruby-changes:49883] nobu:r62001 (trunk): keywords: shrink struct kwtable

nobu	2018-01-21 18:59:45 +0900 (Sun, 21 Jan 2018)

  New Revision: 62001

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

  Log:
    keywords: shrink struct kwtable
    
    * defs/keywords (struct kwtable): shrink since members do not
      exceed 16bit.  lex_state needs to be int (or enum lex_state_e)
      when EXPR_MAX_STATE reaches it.

  Modified files:
    trunk/defs/keywords
    trunk/defs/lex.c.src
    trunk/lex.c.blt
Index: lex.c.blt
===================================================================
--- lex.c.blt	(revision 62000)
+++ lex.c.blt	(revision 62001)
@@ -31,7 +31,7 @@ https://github.com/ruby/ruby/blob/trunk/lex.c.blt#L31
 #define gperf_offsetof(s, n) (short)offsetof(struct s##_t, s##_str##n)
 #line 1 "defs/keywords"
 
-struct kwtable {int name, id[2], state;};
+struct kwtable {short name, id[2], state;};
 const struct kwtable *rb_reserved_word(const char *, unsigned int);
 #ifndef RIPPER
 static const struct kwtable *reserved_word(/*const char *, unsigned int*/);
Index: defs/lex.c.src
===================================================================
--- defs/lex.c.src	(revision 62000)
+++ defs/lex.c.src	(revision 62001)
@@ -1,5 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/defs/lex.c.src#L1
 %{
-struct kwtable {int name, id[2], state;};
+struct kwtable {short name, id[2], state;};
 const struct kwtable *rb_reserved_word(const char *, unsigned int);
 #ifndef RIPPER
 static const struct kwtable *reserved_word(/*!ANSI{*/const char *, unsigned int/*}!ANSI*/);
Index: defs/keywords
===================================================================
--- defs/keywords	(revision 62000)
+++ defs/keywords	(revision 62001)
@@ -1,5 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/defs/keywords#L1
 %{
-struct kwtable {int name, id[2], state;};
+struct kwtable {short name, id[2], state;};
 const struct kwtable *rb_reserved_word(const char *, unsigned int);
 #ifndef RIPPER
 static const struct kwtable *reserved_word(/*!ANSI{*/const char *, unsigned int/*}!ANSI*/);

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

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