diff options
author | Carsten Haitzler (Rasterman) <raster@rasterman.com> | 2016-11-03 18:51:19 +0900 |
---|---|---|
committer | Carsten Haitzler (Rasterman) <raster@rasterman.com> | 2016-11-03 22:22:54 +0900 |
commit | 51b2789a353b81e7fd89781acae782b34908985b (patch) | |
tree | 693988718186ee5bbbe9d888c4dd2e6536515b77 /src/lib/evas/common | |
parent | 4ed2e01591e1575800d9aa871f76a5f7559060b3 (diff) |
evas lang unicode tables - reduce memory by 24k+1324 bytes
so bu5hman pointed out a compile warning from clang that
{ 0x20000, 42711, EVAS_SCRIPT_HAN },
has 42711 exceeding a signed short. true. so this should be an
unsigned short. but this drew me to the fact the whole array could be
shorter by packing this short with the style memeber after it making
them pack into a nicely aligned 4 byte chunk next to the start unicode
value before it, thus chopping 1324 bytes off this table. even worse
the 8192 entry fast table above is using a full 32bits per entry where
they data they store is not even exceeding 7bits, so move this to an
unsigned char saving another 24k. this should reduce cache misses and
memory footprint and binary footprint of the evas .so files etc.
@fix + @optimize
Diffstat (limited to 'src/lib/evas/common')
-rw-r--r-- | src/lib/evas/common/language/evas_script_table.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/evas/common/language/evas_script_table.h b/src/lib/evas/common/language/evas_script_table.h index dd77db04e8..e89747436d 100644 --- a/src/lib/evas/common/language/evas_script_table.h +++ b/src/lib/evas/common/language/evas_script_table.h | |||
@@ -14,7 +14,7 @@ | |||
14 | #define EVAS_SCRIPT_DIRECT_TABLE_LIMIT 8192 | 14 | #define EVAS_SCRIPT_DIRECT_TABLE_LIMIT 8192 |
15 | 15 | ||
16 | static const | 16 | static const |
17 | Eina_Unicode _evas_script_fast_table[EVAS_SCRIPT_DIRECT_TABLE_LIMIT] = { | 17 | unsigned char _evas_script_fast_table[EVAS_SCRIPT_DIRECT_TABLE_LIMIT] = { |
18 | EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, | 18 | EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, |
19 | EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, | 19 | EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, |
20 | EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, | 20 | EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, EVAS_SCRIPT_COMMON, |
@@ -2749,9 +2749,9 @@ Eina_Unicode _evas_script_fast_table[EVAS_SCRIPT_DIRECT_TABLE_LIMIT] = { | |||
2749 | }; | 2749 | }; |
2750 | 2750 | ||
2751 | static const struct { | 2751 | static const struct { |
2752 | Eina_Unicode start; | 2752 | Eina_Unicode start; // int - 4 |
2753 | short len; | 2753 | unsigned short len; // short - 2 |
2754 | Evas_Script_Type script; | 2754 | unsigned short script; // short 2 -- total. 8 bytes per entry |
2755 | } _evas_script_slow_table[] = { | 2755 | } _evas_script_slow_table[] = { |
2756 | { 0x2000, 12, EVAS_SCRIPT_COMMON }, | 2756 | { 0x2000, 12, EVAS_SCRIPT_COMMON }, |
2757 | { 0x200c, 2, EVAS_SCRIPT_INHERITED }, | 2757 | { 0x200c, 2, EVAS_SCRIPT_INHERITED }, |