Fail in the right place when we cannot allocate a mark stack.
Previously we'd keep going and then crash when dereferencing
the mark stack later. I expected dalvikvm to throw an OutOfMemoryError
in this scenario but it also aborts.
Change-Id: I3cd995113561f40b191fcb51ecfcb1f032bed4ec
diff --git a/src/mark_sweep.cc b/src/mark_sweep.cc
index bf4f1bf..d44796c 100644
--- a/src/mark_sweep.cc
+++ b/src/mark_sweep.cc
@@ -22,12 +22,8 @@
namespace art {
-bool MarkSweep::Init() {
+void MarkSweep::Init() {
mark_stack_ = MarkStack::Create();
- if (mark_stack_ == NULL) {
- return false;
- }
-
mark_bitmap_ = Heap::GetMarkBits();
live_bitmap_ = Heap::GetLiveBits();
@@ -36,8 +32,6 @@
// TODO: if concurrent, enable card marking in compiler
// TODO: check that the mark bitmap is entirely clear.
-
- return true;
}
inline void MarkSweep::MarkObject0(const Object* obj, bool check_finger) {