Skip to content

Commit ca69e64

Browse files
committed
Adding assertion to check size when copying a hashed object
1 parent 1a58549 commit ca69e64

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

mmtk/src/object_model.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,11 @@ impl ObjectModel<JuliaVM> for VMObjectModel {
105105
debug_assert!(test_hash_state(to_obj, UNHASHED));
106106
to_obj
107107
} else if test_hash_state(from, HASHED) {
108-
info!("Moving a hashed object {}", from);
108+
info!("Moving a hashed object {} with size = {}. New size = {}", from, cur_bytes, new_bytes);
109+
// if cur_bytes == new_bytes you end up copying the whole src
110+
// but before you say that dst += STORED_HASH_BYTES so you don't have space
111+
// in dst to copy src
112+
debug_assert_ne!(cur_bytes, new_bytes);
109113
debug_assert_eq!(header_offset, 8);
110114

111115
// Store hash

0 commit comments

Comments
 (0)