diff options
author | 2017-06-09 18:34:11 -0700 | |
---|---|---|
committer | 2017-06-12 18:10:35 -0700 | |
commit | db40eac139e2bc2b7b450277f4ba63c131d30dbc (patch) | |
tree | e91b75a9fc69c28b06e91c9028d7fc29dcfaa1a0 /runtime/dex_reference_collection.h | |
parent | 16d59b2b0ff202be99cbe24830e8a5080b774357 (diff) |
Address review comments for aog/411660
Added test for bulk adding method apis.
Test: test-art-host
Change-Id: Ib5b8c73e572110bccbbab031c11f030c23545fba
Diffstat (limited to 'runtime/dex_reference_collection.h')
-rw-r--r-- | runtime/dex_reference_collection.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/runtime/dex_reference_collection.h b/runtime/dex_reference_collection.h index 76355d6335..01b9b97786 100644 --- a/runtime/dex_reference_collection.h +++ b/runtime/dex_reference_collection.h @@ -63,12 +63,13 @@ class DexReferenceCollection { private: DexFileMap map_; - // Optimize for adding to same vector in succession. const DexFile* current_dex_file_ = nullptr; IndexVector* current_vector_ = nullptr; VectorAllocator vector_allocator_; ALWAYS_INLINE IndexVector* GetOrInsertVector(const DexFile* dex) { + // Optimize for adding to same vector in succession, the cached dex file and vector aims to + // prevent map lookups. if (UNLIKELY(current_dex_file_ != dex)) { // There is an assumption that constructing an empty vector wont do any allocations. If this // incorrect, this might leak for the arena case. |