You need to sign in or sign up before continuing.
提交 aa28b98d 编写于 作者: C Colin Ian King 提交者: Gabriel Krisman Bertazi

unicode: make array 'token' static const, makes object smaller

Don't populate the array 'token' on the stack but instead make it
static const. Makes the object code smaller by 234 bytes.

Before:
   text	   data	    bss	    dec	    hex	filename
   5371	    272	      0	   5643	   160b	fs/unicode/utf8-core.o

After:
   text	   data	    bss	    dec	    hex	filename
   5041	    368	      0	   5409	   1521	fs/unicode/utf8-core.o

(gcc version 9.2.1, amd64)
Signed-off-by: NColin Ian King <colin.king@canonical.com>
Reviewed-by: NTheodore Ts'o <tytso@mit.edu>
Signed-off-by: NGabriel Krisman Bertazi <krisman@collabora.com>
上级 334b427e
...@@ -154,7 +154,7 @@ static int utf8_parse_version(const char *version, unsigned int *maj, ...@@ -154,7 +154,7 @@ static int utf8_parse_version(const char *version, unsigned int *maj,
{ {
substring_t args[3]; substring_t args[3];
char version_string[12]; char version_string[12];
const struct match_token token[] = { static const struct match_token token[] = {
{1, "%d.%d.%d"}, {1, "%d.%d.%d"},
{0, NULL} {0, NULL}
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册