summaryrefslogtreecommitdiffstats
path: root/compiler/image_writer.cc
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/image_writer.cc')
-rw-r--r--compiler/image_writer.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/compiler/image_writer.cc b/compiler/image_writer.cc
index a45c2d1ba..eb1b5db95 100644
--- a/compiler/image_writer.cc
+++ b/compiler/image_writer.cc
@@ -548,6 +548,7 @@ void ImageWriter::ProcessStrings() {
}
// Create character array, copy characters and point the strings there.
mirror::CharArray* array = mirror::CharArray::Alloc(self, num_chars);
+ string_data_array_ = array;
uint16_t* array_data = array->GetData();
size_t pos = 0u;
prev_s = nullptr;
@@ -1234,4 +1235,13 @@ uint32_t ImageWriter::BinSlot::GetIndex() const {
return lockword_ & ~kBinMask;
}
+void ImageWriter::FreeStringDataArray() {
+ if (string_data_array_ != nullptr) {
+ gc::space::LargeObjectSpace* los = Runtime::Current()->GetHeap()->GetLargeObjectsSpace();
+ if (los != nullptr) {
+ los->Free(Thread::Current(), reinterpret_cast<mirror::Object*>(string_data_array_));
+ }
+ }
+}
+
} // namespace art