diff options
author | Mathieu Chartier <mathieuc@google.com> | 2013-09-12 17:33:56 -0700 |
---|---|---|
committer | Mathieu Chartier <mathieuc@google.com> | 2013-09-13 10:30:24 -0700 |
commit | 423d2a3dcbb260b020efb5da59f784c9f02accbf (patch) | |
tree | 79ed739e6072f8308c1cd880f9420a1c63539c95 /runtime/intern_table.cc | |
parent | b048dd2b662c19644361f4396a1e8d6213445ee8 (diff) | |
download | art-423d2a3dcbb260b020efb5da59f784c9f02accbf.zip art-423d2a3dcbb260b020efb5da59f784c9f02accbf.tar.gz art-423d2a3dcbb260b020efb5da59f784c9f02accbf.tar.bz2 |
Add support for changing roots through the root visitor callback.
Needed for copying collectors.
Change-Id: Icc4a342a57e0cfb79587edb02ef8c85e08808877
Diffstat (limited to 'runtime/intern_table.cc')
-rw-r--r-- | runtime/intern_table.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/runtime/intern_table.cc b/runtime/intern_table.cc index e3a75cf..6b0a51b 100644 --- a/runtime/intern_table.cc +++ b/runtime/intern_table.cc @@ -44,14 +44,14 @@ void InternTable::DumpForSigQuit(std::ostream& os) const { void InternTable::VisitRoots(RootVisitor* visitor, void* arg, bool clean_dirty) { MutexLock mu(Thread::Current(), intern_table_lock_); - for (const auto& strong_intern : strong_interns_) { - visitor(strong_intern.second, arg); + for (auto& strong_intern : strong_interns_) { + strong_intern.second = reinterpret_cast<mirror::String*>(visitor(strong_intern.second, arg)); + DCHECK(strong_intern.second != nullptr); } if (clean_dirty) { is_dirty_ = false; } - // Note: we deliberately don't visit the weak_interns_ table and the immutable - // image roots. + // Note: we deliberately don't visit the weak_interns_ table and the immutable image roots. } mirror::String* InternTable::Lookup(Table& table, mirror::String* s, |