Address comment for aog/502433
Added a comment describing the fix.
Bug: 37885600
Test: test-art-host
Change-Id: Ia21ce29a6bee1b8f6992a2c051b32b5ab4356191
diff --git a/runtime/gc/heap.cc b/runtime/gc/heap.cc
index 10fa4d2..4004af2 100644
--- a/runtime/gc/heap.cc
+++ b/runtime/gc/heap.cc
@@ -3855,6 +3855,8 @@
}
void Heap::CheckPreconditionsForAllocObject(ObjPtr<mirror::Class> c, size_t byte_count) {
+ // Compare rounded sizes since the allocation may have been retried after rounding the size.
+ // See b/37885600
CHECK(c == nullptr || (c->IsClassClass() && byte_count >= sizeof(mirror::Class)) ||
(c->IsVariableSize() ||
RoundUp(c->GetObjectSize(), kObjectAlignment) ==