OSDN Git Service

Improve large object free CHECK
authorMathieu Chartier <mathieuc@google.com>
Thu, 15 May 2014 16:35:48 +0000 (09:35 -0700)
committerMathieu Chartier <mathieuc@google.com>
Thu, 15 May 2014 16:36:40 +0000 (09:36 -0700)
The new CHECK prints the address of the object.

Bug: 14974497

Change-Id: I8e9e9f66767a220330cc77ef6549529bb2ac4112

runtime/gc/space/large_object_space.cc

index dc2769e..554fbbe 100644 (file)
@@ -140,7 +140,8 @@ mirror::Object* LargeObjectMapSpace::Alloc(Thread* self, size_t num_bytes,
 size_t LargeObjectMapSpace::Free(Thread* self, mirror::Object* ptr) {
   MutexLock mu(self, lock_);
   MemMaps::iterator found = mem_maps_.find(ptr);
-  CHECK(found != mem_maps_.end()) << "Attempted to free large object which was not live";
+  CHECK(found != mem_maps_.end()) << "Attempted to free large object" << ptr
+      << "which was not live";
   DCHECK_GE(num_bytes_allocated_, found->second->Size());
   size_t allocation_size = found->second->Size();
   num_bytes_allocated_ -= allocation_size;