aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sfnt
diff options
context:
space:
mode:
authorGravatar Bruce Dawson <brucedawson@google.com>2016-12-29 14:05:39 -0800
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-01-03 00:11:53 +0000
commit34194690328b612557f06ecec99b232d41888d4b (patch)
treecd36d78ba90f9a44ae22170588979f1b09b294b2 /src/sfnt
parentc0b4d21e13b33b787f26f3f3aa9570e9ed782959 (diff)
Move two skia arrays to read-only data segment
The BCP47FromLanguageID and UnicodeFromMacRoman arrays are logically const but were not marked as such. Marking them as const lets the compiler/linker store them in the read-only data segment, which is strictly better than being in read/write memory. This change moves about 3,000 bytes from the .data to .rdata segment in both chrome.dll and chrome_child.dll. BUG=677351 Change-Id: I85ff44d61aa232cf29178833fd2bb2e004032b9e Reviewed-on: https://skia-review.googlesource.com/6424 Reviewed-by: Brian Salomon <bsalomon@google.com> Reviewed-by: Bruce Dawson <brucedawson@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'src/sfnt')
-rw-r--r--src/sfnt/SkOTTable_name.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/sfnt/SkOTTable_name.cpp b/src/sfnt/SkOTTable_name.cpp
index 476e0ce368..9670b6f91e 100644
--- a/src/sfnt/SkOTTable_name.cpp
+++ b/src/sfnt/SkOTTable_name.cpp
@@ -46,7 +46,7 @@ static void SkStringFromUTF16BE(const uint16_t* utf16be, size_t length, SkString
* In MacRoman the first 128 code points match ASCII code points.
* This maps the second 128 MacRoman code points to unicode code points.
*/
-static uint16_t UnicodeFromMacRoman[0x80] = {
+static const uint16_t UnicodeFromMacRoman[0x80] = {
0x00C4, 0x00C5, 0x00C7, 0x00C9, 0x00D1, 0x00D6, 0x00DC, 0x00E1,
0x00E0, 0x00E2, 0x00E4, 0x00E3, 0x00E5, 0x00E7, 0x00E9, 0x00E8,
0x00EA, 0x00EB, 0x00ED, 0x00EC, 0x00EE, 0x00EF, 0x00F1, 0x00F3,
@@ -73,7 +73,7 @@ static void SkStringFromMacRoman(const uint8_t* macRoman, size_t length, SkStrin
}
}
-static struct BCP47FromLanguageId {
+static const struct BCP47FromLanguageId {
uint16_t languageID;
const char* bcp47;
}