diff options
| -rw-r--r-- | runtime/gc/heap.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/runtime/gc/heap.cc b/runtime/gc/heap.cc index 6377c892c3..10fa4d2429 100644 --- a/runtime/gc/heap.cc +++ b/runtime/gc/heap.cc @@ -3856,14 +3856,16 @@ void Heap::AddModUnionTable(accounting::ModUnionTable* mod_union_table) { void Heap::CheckPreconditionsForAllocObject(ObjPtr<mirror::Class> c, size_t byte_count) { CHECK(c == nullptr || (c->IsClassClass() && byte_count >= sizeof(mirror::Class)) || - (c->IsVariableSize() || c->GetObjectSize() == byte_count)) + (c->IsVariableSize() || + RoundUp(c->GetObjectSize(), kObjectAlignment) == + RoundUp(byte_count, kObjectAlignment))) << "ClassFlags=" << c->GetClassFlags() << " IsClassClass=" << c->IsClassClass() << " byte_count=" << byte_count << " IsVariableSize=" << c->IsVariableSize() << " ObjectSize=" << c->GetObjectSize() << " sizeof(Class)=" << sizeof(mirror::Class) - << verification_->DumpObjectInfo(c.Ptr(), /*tag*/ "klass"); + << " " << verification_->DumpObjectInfo(c.Ptr(), /*tag*/ "klass"); CHECK_GE(byte_count, sizeof(mirror::Object)); } |