Skip to content

Commit 85ab012

Browse files
committed
No longer do align up in llt_align
1 parent ca69e64 commit 85ab012

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

mmtk/src/object_model.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ impl ObjectModel<JuliaVM> for VMObjectModel {
109109
// if cur_bytes == new_bytes you end up copying the whole src
110110
// but before you say that dst += STORED_HASH_BYTES so you don't have space
111111
// in dst to copy src
112-
debug_assert_ne!(cur_bytes, new_bytes);
112+
debug_assert_eq!(cur_bytes + STORED_HASH_BYTES, new_bytes);
113113
debug_assert_eq!(header_offset, 8);
114114

115115
// Store hash
@@ -403,9 +403,15 @@ pub unsafe fn get_object_start_ref(object: ObjectReference) -> Address {
403403
}
404404
}
405405

406+
// DONT USE THIS FUNCTION ANYWHERE OTHER THAN OBJECT SIZE QUERY, AS IT DOES NOT ALIGN UP AT ALL.
407+
// This function is only used to align up the object size when we query object size.
408+
// However, it seems that we don't need to align up. I am still keeping this function,
409+
// in case that we figure out in the future that we actually need this align up.
410+
// If we are certain that this align up is unnecessary, we can just remove this function.
406411
#[inline(always)]
407-
pub unsafe fn llt_align(size: usize, align: usize) -> usize {
408-
((size) + (align) - 1) & !((align) - 1)
412+
unsafe fn llt_align(size: usize, align: usize) -> usize {
413+
// ((size) + (align) - 1) & !((align) - 1)
414+
size
409415
}
410416

411417
#[inline(always)]

0 commit comments

Comments
 (0)