Skip to content

Commit 7c7c0fb

Browse files
committed
Align up alloc_copy bytes
1 parent 7ff4562 commit 7c7c0fb

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

mmtk/src/object_model.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,13 @@ impl ObjectModel<JuliaVM> for VMObjectModel {
8383
let from_start = Self::ref_to_object_start(from);
8484
let header_offset = from_addr - from_start;
8585

86+
let aligned_new_bytes = mmtk::util::conversions::raw_align_up(new_bytes, JuliaVM::MIN_ALIGNMENT);
8687
let mut dst = if test_hash_state(from, UNHASHED) {
8788
// 8 bytes offset, for 8 bytes header
88-
copy_context.alloc_copy(from, new_bytes, 16, 8, semantics)
89+
copy_context.alloc_copy(from, aligned_new_bytes, 16, 8, semantics)
8990
} else {
9091
// 0 bytes offset, for 16 bytes header
91-
copy_context.alloc_copy(from, new_bytes, 16, 0, semantics)
92+
copy_context.alloc_copy(from, aligned_new_bytes, 16, 0, semantics)
9293
};
9394

9495
// `alloc_copy` should never return zero.

0 commit comments

Comments
 (0)