Skip to content

Commit aa28b98

Browse files
Colin Ian Kingkrisman-at-collabora
authored andcommitted
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: Colin Ian King <colin.king@canonical.com> Reviewed-by: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.com>
1 parent 334b427 commit aa28b98

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎fs/unicode/utf8-core.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ static int utf8_parse_version(const char *version, unsigned int *maj,
154154
{
155155
substring_t args[3];
156156
char version_string[12];
157-
const struct match_token token[] = {
157+
static const struct match_token token[] = {
158158
{1, "%d.%d.%d"},
159159
{0, NULL}
160160
};

0 commit comments

Comments
 (0)