From db40eac139e2bc2b7b450277f4ba63c131d30dbc Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Fri, 9 Jun 2017 18:34:11 -0700 Subject: Address review comments for aog/411660 Added test for bulk adding method apis. Test: test-art-host Change-Id: Ib5b8c73e572110bccbbab031c11f030c23545fba --- runtime/dex_reference_collection.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'runtime/dex_reference_collection.h') 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. -- cgit v1.2.3-59-g8ed1b