summaryrefslogtreecommitdiff
path: root/libs/utils/Asset.cpp
diff options
context:
space:
mode:
author Dianne Hackborn <hackbod@google.com> 2009-07-06 11:07:40 -0700
committer Dianne Hackborn <hackbod@google.com> 2009-07-06 11:12:37 -0700
commit78c405178c57bb45e40f1e2839d6a18d91f7f02c (patch)
tree6e7137f628b8fff1f72c59e5e42f3f4878e0bb39 /libs/utils/Asset.cpp
parentef1f21b34f5624adb7436d3da927660ed16c97c7 (diff)
Don't re-parse the framework resources all the time.
A small optimization to the resource code, to not re-parse the framework resources every time we build a new AssetManager. Instead, you can now construct a ResTable from a previously created one... of course, like the existing code for using the data in-place, you can't delete the original ResTable until you have deleted the one that has been constructed from it.
Diffstat (limited to 'libs/utils/Asset.cpp')
-rw-r--r--libs/utils/Asset.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/libs/utils/Asset.cpp b/libs/utils/Asset.cpp
index 91203ddb45b6..23cb72d4efca 100644
--- a/libs/utils/Asset.cpp
+++ b/libs/utils/Asset.cpp
@@ -582,11 +582,14 @@ const void* _FileAsset::ensureAlignment(FileMap* map)
if ((((size_t)data)&0x3) == 0) {
// We can return this directly if it is aligned on a word
// boundary.
+ LOGV("Returning aligned FileAsset %p (%s).", this,
+ getAssetSource());
return data;
}
// If not aligned on a word boundary, then we need to copy it into
// our own buffer.
- LOGV("Copying FileAsset %p to buffer size %d to make it aligned.", this, (int)mLength);
+ LOGV("Copying FileAsset %p (%s) to buffer size %d to make it aligned.", this,
+ getAssetSource(), (int)mLength);
unsigned char* buf = new unsigned char[mLength];
if (buf == NULL) {
LOGE("alloc of %ld bytes failed\n", (long) mLength);