summaryrefslogtreecommitdiffstats
path: root/runtime/runtime.cc
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/runtime.cc')
-rw-r--r--runtime/runtime.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/runtime/runtime.cc b/runtime/runtime.cc
index 94d6cdfc3..c354ad51c 100644
--- a/runtime/runtime.cc
+++ b/runtime/runtime.cc
@@ -910,11 +910,13 @@ void Runtime::DetachCurrentThread() {
thread_list_->Unregister(self);
}
- mirror::Throwable* Runtime::GetPreAllocatedOutOfMemoryError() const {
- if (pre_allocated_OutOfMemoryError_ == NULL) {
+mirror::Throwable* Runtime::GetPreAllocatedOutOfMemoryError() {
+ mirror::Throwable* oome = ReadBarrier::BarrierForRoot<mirror::Throwable, kWithReadBarrier>(
+ &pre_allocated_OutOfMemoryError_);
+ if (oome == NULL) {
LOG(ERROR) << "Failed to return pre-allocated OOME";
}
- return pre_allocated_OutOfMemoryError_;
+ return oome;
}
void Runtime::VisitConstantRoots(RootCallback* callback, void* arg) {