]> git.saurik.com Git - android/aapt.git/commit - StringPool.cpp
Use UTF-8 strings to avoid duplicate caching, part 1
authorKenny Root <kroot@google.com>
Tue, 23 Feb 2010 06:36:26 +0000 (22:36 -0800)
committerKenny Root <kroot@google.com>
Tue, 23 Feb 2010 18:02:20 +0000 (10:02 -0800)
commit054e9517d9586fb31af8d3bb8dcffc0b76e06ac4
treea04dcc1b2a2cb6e2cf12f7eb98b21c91dfe8a1cc
parent491d9ef01e52e62a426bc963fc9c79e9703459ee
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
StringPool.cpp