Handle OOMEs in class linker with grace.
Check for OOMEs and then fail due to them in class loading.
Make the compiler driver spot OOMEs during resolution and abort compilation to
avoid needless GC thrash then eventual death.
Allocate the pre-allocated OOME during Runtime::Init as Runtime::Start isn't
called in the context of the compiler/tools.
Change-Id: Id72199d0fe82001b5bf22758b3cdc9cc4b8efbb9
diff --git a/runtime/runtime.h b/runtime/runtime.h
index 50108ac..21161a0 100644
--- a/runtime/runtime.h
+++ b/runtime/runtime.h
@@ -287,9 +287,8 @@
return monitor_list_;
}
- mirror::Throwable* GetPreAllocatedOutOfMemoryError() {
- return pre_allocated_OutOfMemoryError_;
- }
+ mirror::Throwable* GetPreAllocatedOutOfMemoryError() const
+ SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
const std::vector<std::string>& GetProperties() const {
return properties_;