summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHiroshi Yamauchi <yamauchi@google.com>2014-05-19 12:49:45 -0700
committerHiroshi Yamauchi <yamauchi@google.com>2014-05-19 14:15:59 -0700
commit13bf2e6a6c14bccf5377998b7568100ffd417f8e (patch)
treeedf65cb261ddc5a7d3707ce33c60bad650dce683
parent666f4b95d075e9c412f9333c3167b2d68b3cc933 (diff)
downloadart-13bf2e6a6c14bccf5377998b7568100ffd417f8e.tar.gz
art-13bf2e6a6c14bccf5377998b7568100ffd417f8e.tar.bz2
art-13bf2e6a6c14bccf5377998b7568100ffd417f8e.zip
Check and log a to-space overflow explicitly.
Measured no noticeable performance regression with Ritzperf EvaluateAndApplyChanges and -Xgc:SS on Mako. Change-Id: Ib5ab934b867f91789a82ae771b45c95e9d01390c
-rw-r--r--runtime/gc/collector/semi_space.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/runtime/gc/collector/semi_space.cc b/runtime/gc/collector/semi_space.cc
index 95a2c96091..d4e26ab083 100644
--- a/runtime/gc/collector/semi_space.cc
+++ b/runtime/gc/collector/semi_space.cc
@@ -590,6 +590,7 @@ mirror::Object* SemiSpace::MarkNonForwardedObject(mirror::Object* obj) {
// If it's allocated after the last GC (younger), copy it to the to-space.
forward_address = to_space_->AllocThreadUnsafe(self_, object_size, &bytes_allocated, nullptr);
}
+ CHECK(forward_address != nullptr) << "Out of memory in the to-space.";
++objects_moved_;
bytes_moved_ += bytes_allocated;
// Copy over the object and add it to the mark stack since we still need to update its