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
diff --git a/runtime/jit/profile_compilation_info.cc b/runtime/jit/profile_compilation_info.cc
index d1ce01b..9b80ad7 100644
--- a/runtime/jit/profile_compilation_info.cc
+++ b/runtime/jit/profile_compilation_info.cc
@@ -84,6 +84,9 @@
ProfileCompilationInfo::~ProfileCompilationInfo() {
VLOG(profiler) << Dumpable<MemStats>(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 2dd91e7..6756352 100644
--- a/runtime/jit/profile_compilation_info.h
+++ b/runtime/jit/profile_compilation_info.h
@@ -301,7 +301,7 @@
// 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<kArenaAllocProfile> {
+ struct DexFileData : public DeletableArenaObject<kArenaAllocProfile> {
DexFileData(ArenaAllocator* arena,
const std::string& key,
uint32_t location_checksum,