summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorKenny Root <kroot@google.com>2010-02-22 22:36:26 -0800
committerKenny Root <kroot@google.com>2010-02-23 10:02:20 -0800
commit9e333ab42c5ca09632f56cd5d8e5349e06a632b7 (patch)
tree3f9e1b8b26a302f72ebe08468f2fec8ad3a5029a /include
parentfc10cf951a0f12315b96e35a7e8d360748eea302 (diff)
downloadframeworks_native-9e333ab42c5ca09632f56cd5d8e5349e06a632b7.zip
frameworks_native-9e333ab42c5ca09632f56cd5d8e5349e06a632b7.tar.gz
frameworks_native-9e333ab42c5ca09632f56cd5d8e5349e06a632b7.tar.bz2
Use UTF-8 strings to avoid duplicate caching, part 1
StringBlock instances containing UTF-8 strings use a cache to convert into UTF-16, but using that cache and then using a JNI call to NewString causes the UTF-8 string as well as two copies of the UTF-16 string to be held in memory. Getting the UTF-8 string directly from the StringPool eliminates one copy of the UTF-16 string being held in memory. This is part 1. Part 2 will include ResXMLParser optimizations. Change-Id: Ibd4509a485db746d59cd4b9501f544877139276c
Diffstat (limited to 'include')
-rw-r--r--include/utils/ResourceTypes.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/utils/ResourceTypes.h b/include/utils/ResourceTypes.h
index 13ea27e..cd657e8 100644
--- a/include/utils/ResourceTypes.h
+++ b/include/utils/ResourceTypes.h
@@ -447,6 +447,8 @@ public:
}
const char16_t* stringAt(size_t idx, size_t* outLen) const;
+ const char* string8At(size_t idx, size_t* outLen) const;
+
const ResStringPool_span* styleAt(const ResStringPool_ref& ref) const;
const ResStringPool_span* styleAt(size_t idx) const;