Skip to content

Commit 10da080

Browse files
committed
doc: explain how fields _should_ be aligned in syscall out types
1 parent 4c1a6c8 commit 10da080

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

fvm/src/syscalls/vm.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use fvm_shared::error::ExitCode;
22
use fvm_shared::sys::SyscallSafe;
33
use fvm_shared::version::NetworkVersion;
4-
use num_traits::FromPrimitive;
54

65
use super::error::Abort;
76
use super::Context;

shared/src/sys/out.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@
77
//!
88
//! Read more at https://github.com/rust-lang/rust/issues/73755.
99
10+
// NOTE: When possible, pack fields such that loads will be power-of-two aligned. Un-aligned loads
11+
// _can_ be done (LLVM will generate the appropriate code) but are slower.
12+
//
13+
// Read up on https://doc.rust-lang.org/reference/type-layout.html for more information.
14+
//
15+
// Also, please also read the docs on super::SyscallSafe before modifying any of these types.
16+
1017
pub mod actor {
1118
#[derive(Debug, Copy, Clone)]
1219
#[repr(packed, C)]

0 commit comments

Comments
 (0)