52 53 void ZForwarding::verify() const { 54 guarantee(_refcount > 0, "Invalid refcount"); 55 guarantee(_page != NULL, "Invalid page"); 56 57 uint32_t live_objects = 0; 58 59 for (ZForwardingCursor i = 0; i < _entries.length(); i++) { 60 const ZForwardingEntry entry = at(&i); 61 if (!entry.populated()) { 62 // Skip empty entries 63 continue; 64 } 65 66 // Check from index 67 guarantee(entry.from_index() < _page->object_max_count(), "Invalid from index"); 68 69 // Check for duplicates 70 for (ZForwardingCursor j = i + 1; j < _entries.length(); j++) { 71 const ZForwardingEntry other = at(&j); 72 if (!other.populated()) { 73 // Skip empty entries 74 continue; 75 } 76 77 guarantee(entry.from_index() != other.from_index(), "Duplicate from"); 78 guarantee(entry.to_offset() != other.to_offset(), "Duplicate to"); 79 } 80 81 live_objects++; 82 } 83 84 // Check number of non-empty entries 85 guarantee(live_objects == _page->live_objects(), "Invalid number of entries"); 86 } | 52 53 void ZForwarding::verify() const { 54 guarantee(_refcount > 0, "Invalid refcount"); 55 guarantee(_page != NULL, "Invalid page"); 56 57 uint32_t live_objects = 0; 58 59 for (ZForwardingCursor i = 0; i < _entries.length(); i++) { 60 const ZForwardingEntry entry = at(&i); 61 if (!entry.populated()) { 62 // Skip empty entries 63 continue; 64 } 65 66 // Check from index 67 guarantee(entry.from_index() < _page->object_max_count(), "Invalid from index"); 68 69 // Check for duplicates 70 for (ZForwardingCursor j = i + 1; j < _entries.length(); j++) { 71 const ZForwardingEntry other = at(&j); 72 guarantee(entry.from_index() != other.from_index(), "Duplicate from"); 73 guarantee(entry.to_offset() != other.to_offset(), "Duplicate to"); 74 } 75 76 live_objects++; 77 } 78 79 // Check number of non-empty entries 80 guarantee(live_objects == _page->live_objects(), "Invalid number of entries"); 81 } |