From 34194690328b612557f06ecec99b232d41888d4b Mon Sep 17 00:00:00 2001 From: Bruce Dawson Date: Thu, 29 Dec 2016 14:05:39 -0800 Subject: 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 Reviewed-by: Bruce Dawson Commit-Queue: Mike Klein --- src/sfnt/SkOTTable_name.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/sfnt') 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; } -- cgit v1.2.3