From 798ba16bda747d74a27b7a748d3bb5deb2ccbf68 Mon Sep 17 00:00:00 2001 From: Calin Juravle Date: Tue, 23 May 2017 23:01:53 -0700 Subject: Use DeletableArenaObject for DexFileData DexFileData contains the profile key as an std::string which must be deleted before the profile arena is destroyed. Test: make valgrind-test-art-host-gtest Bug: 37711886 Change-Id: I54e71917a65f53b8950f21996d17ecf234295439 --- runtime/jit/profile_compilation_info.cc | 3 +++ runtime/jit/profile_compilation_info.h | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/runtime/jit/profile_compilation_info.cc b/runtime/jit/profile_compilation_info.cc index d1ce01b191..9b80ad71e1 100644 --- a/runtime/jit/profile_compilation_info.cc +++ b/runtime/jit/profile_compilation_info.cc @@ -84,6 +84,9 @@ ProfileCompilationInfo::ProfileCompilationInfo() ProfileCompilationInfo::~ProfileCompilationInfo() { VLOG(profiler) << Dumpable(arena_->GetMemStats()); + for (DexFileData* data : info_) { + delete data; + } } void ProfileCompilationInfo::DexPcData::AddClass(uint16_t dex_profile_idx, diff --git a/runtime/jit/profile_compilation_info.h b/runtime/jit/profile_compilation_info.h index 2dd91e7d33..6756352496 100644 --- a/runtime/jit/profile_compilation_info.h +++ b/runtime/jit/profile_compilation_info.h @@ -301,7 +301,7 @@ class ProfileCompilationInfo { // profile) fields in this struct because we can infer them from // profile_key_map_ and info_. However, it makes the profiles logic much // simpler if we have references here as well. - struct DexFileData : public ArenaObject { + struct DexFileData : public DeletableArenaObject { DexFileData(ArenaAllocator* arena, const std::string& key, uint32_t location_checksum, -- cgit v1.2.3-59-g8ed1b